There is in general not enough information in that date string to know which timezone it was generated in. The +0200
only tells you that the timezone in question is currently ahead of UTC by two hours. It doesn't tell you whether the offset changes throughout the year or from year to year like knowing the actual time zone would tell you. As for the CEST
part, those short timezone names are not meant to be unique (several different timezones may all call themselves CEST
).
As you pointed out in a comment, you can use the string to guess one of the Etc/*
timezones which are at fixed offsets from UTC at all times, but that's it. And also, not all possible offsets exist as Etc/*
timezones, for example Nepal's +0545.
Since you also pointed out in a comment that you need this just for a particular application, so perhaps you might be interested in changing the timezone just for the current process (your application's process) using the TZ environment variable? Using that you could set a timezone line this:
TZ=CEST-2
You have everything you need in the date string you have quoted to do that. (Note the opposite sign on the offset.)
/usr/share/zoneinfo/Etc/
, but only for the full hours, so this won't work with half or quarter hour offsets.jstz
to get a standard timezone info, submit that along with the timestamp, and use it to identify the correct file in/usr/share/zoneinfo
.