How do I elegantly print the date in RFC822 format in Perl? - perl

How can I elegantly print the date in RFC822 format in Perl?

use POSIX qw(strftime);
print strftime("%a, %d %b %Y %H:%M:%S %z", localtime(time())) . "\n";

The DateTime suite gives you a number of different ways, e.g.:
use DateTime;
print DateTime->now()->strftime("%a, %d %b %Y %H:%M:%S %z");
use DateTime::Format::Mail;
print DateTime::Format::Mail->format_datetime( DateTime->now() );
print DateTime->now( formatter => DateTime::Format::Mail->new() );
Update: to give time for some particular timezone, add a time_zone argument
to now():
DateTime->now( time_zone => $ENV{'TZ'}, ... )

It can be done with strftime, but its %a (day) and %b (month) are expressed in the language of the current locale.
From man strftime:
%a The abbreviated weekday name according to the current locale.
%b The abbreviated month name according to the current locale.
The Date field in mail must use only these names (from rfc2822 DATE AND TIME SPECIFICATION):
day = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" /
"Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
Therefore portable code should switch to the C locale:
use POSIX qw(strftime locale_h);
my $old_locale = setlocale(LC_TIME, "C");
my $date_rfc822 = strftime("%a, %d %b %Y %H:%M:%S %z", localtime(time()));
setlocale(LC_TIME, $old_locale);
print "$date_rfc822\n";

Just using POSIX::strftime() has issues that have already been pointed out in other answers and comments on them:
It will not work with MS-DOS aka Windows which produces strings like "W. Europe Standard Time" instead of "+0200" as required by RFC822 for the %z conversion specification.
It will print the abbreviated month and day names in the current locale instead of English, again required by RFC822.
Switching the locale to "POSIX" resp. "C" fixes the latter problem but is potentially expensive, even more for well-behaving code that later switches back to the previous locale.
But it's also not completely thread-safe. While temporarily switching locale will work without issues inside Perl interpreter threads, there are races when the Perl interpreter itself runs inside a kernel thread. This can be the case, when the Perl interpreter is embedded into a server (for example mod_perl running in a threaded Apache MPM).
The following version doesn't suffer from any such limitations because it doesn't use any locale dependent functions:
sub rfc822_local {
my ($epoch) = #_;
my #time = localtime $epoch;
use integer;
my $tz_offset = (Time::Local::timegm(#time) - $now) / 60;
my $tz = sprintf('%s%02u%02u',
$tz_offset < 0 ? '-' : '+',
$tz_offset / 60, $tz_offset % 60);
my #month_names = qw(Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec);
my #day_names = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
return sprintf('%s, %02u %s %04u %02u:%02u:%02u %s',
$day_names[$time[6]], $time[3], $month_names[$time[4]],
$time[5] + 1900, $time[2], $time[1], $time[0], $tz);
}
But it should be noted that converting from seconds since the epoch to a broken down time and vice versa are quite complex and expensive operations, even more when not dealing with GMT/UTC but local time. The latter requires the inspection of zoneinfo data that contains the current and historical DST and time zone settings for the current time zone. It's also error-prone because these parameters are subject to political decisions that may be reverted in the future. Because of that, code relying on the zoneinfo data is brittle and may break, when the system is not regulary updated.
However, the purpose of RFC822 compliant date and time specifications is not to inform other servers about the timezone settings of "your" server but to give its notion of the current date and time in a timezone indepent manner. You can save a lot of CPU cycles (they can be measured in CO2 emission) on both the sending and receiving end by simply using UTC instead of localtime:
sub rfc822_gm {
my ($epoch) = #_;
my #time = gmtime $epoch;
my #month_names = qw(Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec);
my #day_names = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
return sprintf('%s, %02u %s %04u %02u:%02u:%02u +0000',
$day_names[$time[6]], $time[3], $month_names[$time[4]],
$time[5] + 1900, $time[2], $time[1], $time[0]);
}
By hard-coding the timezone to +0000 you avoid all of the above mentioned problems, while still being perfectly standards compliant, leave alone faster. Go with that solution, when performance could be an issue for you. Go with the first solution, when your users complain about the software reporting the "wrong" timezone.

Related

Is there any formula that i can use to how to show up value (month) in between from start to end date in spreadsheet

Is there any formula that I can use to show up each month according to start & end date in spreadsheet.
Example:
Start Date:2022-07-22
End Date:2022-10-22
I expected formula to extract value something like this
Jul - Aug - Sep - Oct
I've tried formula
=IF(A2="","",IF(TEXT(B2,"MM")-TEXT(A2,"MM")>1,CONCATENATE(TEXT(A2,"MMM")&" - "&text(EDATE(A2,1),"MMM")&" - "&TEXT(B2,"MMM")),IF(TEXT(A2,"MMM")=TEXT(B2,"MMM"),TEXT(A2,"MMM"),CONCATENATE(TEXT(A2,"MMM")&" - "&TEXT(B2,"MMM"))))) but it only give me correct value if there is up to 3 month period between start & end date.
Here's a link to the sample spreadsheet
For single cell can try-
=JOIN("-",UNIQUE(INDEX(TEXT(SEQUENCE(B2-A2+1,1,A2),"mmm"))))
For spill array-
=BYROW(A2:INDEX(B2:B,MATCH(9^9,B2:B)),LAMBDA(x,JOIN("-",UNIQUE(INDEX(TEXT(SEQUENCE(INDEX(x,2)-INDEX(x,1)+1,1,INDEX(x,1)),"mmm"))))))
See your sheet.
Get the difference in dates in months using DATEDIF and get dates in each intervening month using EOMONTH+SEQUENCE and convert the end of month dates to TEXT:
Start Date
End Date
Months
2022-07-01
2022-10-30
Jul - Aug - Sep - Oct
2022-08-02
2022-08-31
Aug
2022-07-03
2022-11-01
Jul - Aug - Sep - Oct - Nov
Drag fill formula:
=ARRAYFORMULA(JOIN(" - ",TEXT(EOMONTH(A2,SEQUENCE(DATEDIF(A2,EOMONTH(B2,),"M")+1)-1),"mmm")))
Or as a self adjusting array formula:
=MAP(A2:INDEX(A:A,COUNTA(A:A)),LAMBDA(a, ARRAYFORMULA(JOIN(" - ",TEXT(EOMONTH(a,SEQUENCE(DATEDIF(a,EOMONTH(OFFSET(a,0,1),),"M")+1)-1),"mmm")))))
This should be faster and efficient than getting all the dates and filtering them out one by one, thereby reducing space and time complexity.
Use sequence(), edate() and join(), like this:
=arrayformula( map(
A2:A, B2:B,
lambda(
start, end,
if(
isdate(start) * isdate(end),
join(
" - ",
text(
edate(
start,
sequence(
12 * (year(end) - year(start)) + month(end) - month(start) + 1,
1, 0
)
),
"MMM"
)
),
iferror(1/0)
)
)
) )

parse javascript date to elixir format

I have some saved dates in JavaScript using new Date() that looks like:
"Sun Feb 24 2019 14:44:20 GMT+0200 (Eastern European Standard Time)"
I'm trying to parse these to Elixir DateTime; I didn't find anything in "timex" that can help and I already know that I can use DateTime.from_iso8601 but for dates saved using new Date().toISOString() but what i need is to parse the above string.
Thanks in advance
You can use elixir binary pattern matching to extract the date parts and parse using Timex's RFC1123 format. The RFC1123 is the format e.g Tue, 05 Mar 2013 23:25:19 +0200. Run h Timex.Format.DateTime.Formatters.Default in iex to see other formats.
iex> date_string = "Sun Feb 24 2019 14:44:20 GMT+0200 (Eastern European Standard Time)"
iex> <<day_name::binary-3,_,month_name::binary-3,_,day::binary-2,_,year::binary-4,_,time::binary-8,_::binary-4,offset::binary-5,_,rest::binary>> = date_string
iex> Timex.parse("#{day_name}, #{day} #{month_name} #{year} #{time} #{offset}", "{RFC1123}")
iex> {:ok, #DateTime<2019-02-24 14:44:20+02:00 +02 Etc/GMT-2>}
Pattern matching:
The binary-size are in byte sizes. 1 byte == 1 character. For instance to get
3-character day_name the size is 3. Underscores (_) is used to pattern match the spaces in the date format
Updated answer to use binary-size rather than bitstring-size for simplicity
I didn't find anything in "timex" that can help
The Timex Parsing docs say that you can use strftime sequences, e.g %H:%M:%S, for parsing. Here's a list of strftime characters and what they match.
Here's a format string that I think should work on javascript Dates:
def parse_js_date() do
Timex.parse!("Sun Feb 24 2019 14:44:20 GMT+0200 (Eastern European Standard Time)",
"%a %b %d %Y %H:%M:%S GMT%z (%Z)",
:strftime)
end
Unfortunately, %Z doesn't want to match the time zone name, which causes Timex.parse!() to spit out an error. It looks like %Z in Elixir only matches one word, e.g. a timezone abbreviation EET. Therefore, my simple, clean solution is spoiled.
What you can do is chop off the time zone name before parsing the date string:
def parse_js_date_string() do
[date_str|_tz_name] = String.split(
"Sun Feb 24 2019 14:44:20 GMT+0200 (Eastern European Standard Time)",
" (",
parts: 2
)
Timex.parse!(date_str,
"%a %b %d %Y %H:%M:%S GMT%z",
:strftime)
end
In iex:
~/elixir_programs/my$ iex -S mix
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Compiling 1 file (.ex)
Interactive Elixir (1.6.6) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> My.parse_js_date_string()
#DateTime<2019-02-24 14:44:20+02:00 +02 Etc/GMT-2>
iex(2)>

Gnuplot prints a strange year, 30 years later

I have the next problem with gnuplot, when I print the time gnuplot
prints de time+30years.
This is a part of my data:
1411336800,1390,0,0,0,10,1411,0,10,0,0,0,0,0,1411
1411340400,1506,0,0,0,10,969,0,10,0,0,0,0,0,969
1411344000,1115,0,0,0,10,1108,0,10,0,0,0,0,0,1108
1411347600,719,0,0,0,10,712,0,10,0,0,0,0,0,712
A part of the script is:
set timefmt "%s"
stats "<tail -1 uur.txt " using 1:2 nooutput
tijd = strftime("%d %B %Y %H:%M", STATS_max_x)
print tijd
And then gnuplot prints: 21 September 2044 01:00. 44 ?
Has some one a clue?
I tried several formats but nothing helped.
Until version 4.6, internally gnuplot uses the 1. January 2000 as reference for its date and time functions (in version 5.0 the standard Unix timestamp is used).
You shouldn't have any problems with set timefmt "%s" if you plot the data. But when using strftime it makes a difference. Since you're using tail anyway, you can simply use
tijd = system('date -d #$(tail -1 uur.txt | cut -d, -f1) +"%d %B %Y %H:%M"')
print tijd

Automatically put working week

Right now i am working on a weekly basis gathering the data and put the week and month manually. For example: The working week for today this week is June 23 thru June 29. and the month is June 2014.
I want to gather the YTD data and based on the date put the Week and Month automatically
For example:
Referral Request Date Week Month
1/3/2014 0:00 December 30 thru January 05, 2014 January 2014
1/3/2014 11:10 December 30 thru January 05, 2014 January 2014
12/31/2013 0:00 December 30 thru January 05, 2014 December 2013
6/18/2014 0:00 June 16 thru June 22, 2014 June 2014
6/20/2014 9:51 June 16 thru June 22, 2014 June 2014
4/28/2014 16:34 April 28 thru May 04, 2014 April 2014
5/1/2014 15:22 April 28 thru May 04, 2014 May 2014
The working week will begin each monday and finished on Sunday.
It can be do automatically?? The file have thousand of lines...
Here you are:
#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
use DateTime;
use DateTime::Format::Strptime;
my #datetimes = (
'1/3/2014 0:00',
'1/3/2014 11:10',
'12/31/2013 0:00',
'6/18/2014 0:00',
'6/20/2014 9:51',
'4/28/2014 16:34',
'5/1/2014 15:22',
);
for my $datetime_str (#datetimes) {
my $strp = 'DateTime::Format::Strptime'->new( pattern => '%m/%d/%Y %H:%M' );
my $dt = $strp->parse_datetime($datetime_str);
my $month_year_strp = 'DateTime::Format::Strptime'->new( pattern => '%B %Y' );
my $month_year = $month_year_strp->format_datetime($dt);
my $desired_dow = 1; # Monday
$dt->subtract(days => ($dt->day_of_week - $desired_dow) % 7);
my $month_day_strp = 'DateTime::Format::Strptime'->new( pattern => '%B %d' );
my $monday = $month_day_strp->format_datetime($dt);
$dt->add(days => 6);
my $sunday = $month_day_strp->format_datetime($dt);
say "$datetime_str, $monday thru $sunday, $month_year";
}
Next time help someone else (in case this is what you're after -- I am not sure if I got your question). :-) I used the link posted by #scragar in comments.

How do I set the timezone for Perl's localtime()?

In Perl, I'd like to look up the localtime in a specific timezone. I had been using this technique:
$ENV{TZ} = 'America/Los_Angeles';
my $now = scalar localtime;
print "It is now $now\n";
# WORKS: prints the current time in LA
However, this is not reliable -- notably, if I prepend another localtime() call before setting $ENV{TZ}, it breaks:
localtime();
$ENV{TZ} = 'America/Los_Angeles';
my $now = scalar localtime;
print "It is now $now\n";
# FAILS: prints the current time for here instead of LA
Is there a better way to do this?
Use POSIX::tzset.
use POSIX qw(tzset);
my $was = localtime;
print "It was $was\n";
$ENV{TZ} = 'America/Los_Angeles';
$was = localtime;
print "It is still $was\n";
tzset;
my $now = localtime;
print "It is now $now\n";
$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
Copyright 1987-2006, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
$ perl tzset-test.pl
It was Wed Apr 15 15:58:10 2009
It is still Wed Apr 15 15:58:10 2009
It is now Wed Apr 15 12:58:10 2009
I'd strongly suggest using a module to do this. Specifically, I'd suggest using DateTime (see Perl DateTime Wiki or CPAN
Then you should be able to do something like the following:
use strict;
use warnings;
use DateTime;
my $dt = DateTime->now(); # *your* local time assuming your system knows it!
my $clone1 = $dt->clone; # taking a copy.
$clone1->set_time_zone('America/Los_Angeles');
print "$clone1\n"; # output using ISO 8601 format (there a lot of choices)
print "$dt\n";
Whilst your code works fine for me on both Linux (Perl 5.10.0) and MacOS X (5.8.9), there is a possible solution.
The underlying C functons used by Perl (ctime(), localtime(), etc) call tzset() the first time they're invoked, but not necessarily afterwards. By calling it yourself you should ensure that the timezone structures are correctly re-initialised after any change to $TZ.
Fortunately this is easy - the tzset() function is available in the POSIX module:
#!/usr/bin/perl -w
use POSIX qw[tzset];
$ENV{'TZ'} = 'Europe/London';
tzset();
print scalar localtime();
NB: some Google searches suggest that this is only necessary with Perl versions up to and including 5.8.8. Later versions always call tzset() automatically before each call to localtime().
use Time::Zone;
my $TZ = 'America/Los_Angeles';
my $now = scalar localtime time() + tz_offset($TZ);
print "It is now $now\n";
seems to work here. (The 'scalar' is redundant here since $now gives it scalar context, but it's also nice to be explicit.)
As per the comment, I got the original problem. This seems to fix it for me, but given that others aren't having the original problem, the "seems to work here" bit is intended as an invitation for those people to try this solution as well to ensure it doesn't break anything. (I have to wonder if alnitak noticed the difference between what I posted and the original post?)
Expanding on BrianP007 answer you use both TZ and _tzset
$was = localtime;
print "It was $was\n";
$ENV{TZ} = 'CST6CDT'; # America/Chicago
Time::Piece::_tzset(); # Local time is now Chicago Time
$was = localtime;
print "It is $was\n"; # Right now in Chicago
The trick is the TZ is set from your location to GMT. So normally you would think Chicago is UTC-6, but from Chicago it is 6 hours to UTC which = 'CST6'.
See http://science.ksc.nasa.gov/software/winvn/userguide/3_1_4.htm
Executive Summary:
Setting $ENV{TZ}='/*&+000000000005' and calling Time::Piece::_tzset() fixes localtime() to agree with the windoz system clock.
Sanguinarily gory details:
On Strawberry Perl, windoz 7/64, none of the "Standard" time zones works in the TZ environmental variable to localize localtime(). 'America/Chicago' gives exactly the same time as 'America/Los_Angeles' == 'CDT' == 'CST' == 'UTC' == '-01:00', etc. The list is infinite.
Every timezone on http://www.timeanddate.com/time/zones/ that I tried gives the right time if you are in Greenwich.
Every time from: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
also fails to change localtime() at all. And, there is no apparent indication. They do nothing and say nothing.
There is NO tzset() on windoz:
POSIX::tzset not implemented on this architecture
There is not even any concept of POSIX ???
C:\bin>cpan install POSIX
...
Warning: Cannot install POSIX, don't know what it is.
Try the command i /POSIX/
It appears to be baked into win8 and there are some dot NOT libraries for it.
For Austin, Texas, in the very Center of Central Intergalactic Time, thee correct $ENV{TZ} which gives me a scalar localtime() which ~agrees with the o/s level time function and the windoz clock is:
'/*&+5' !!! Yes Slash-Star-Ampersand-Plus-5 works!
P:\br1\sxsw.2015\sx-2015.0318\done>time
The current time is: 16:36:39.44
...
Time=Apr 14 16:36:42 2015, ENV->TZ=/*&+5
By running a for loop and trying random values from various posts, for Strawberry Perl uname='Win32 strawberry-perl 5.18.2.2...' with known timezone bugs, any 3 chars I tried (didn't try + or -) followed by +/- and a small number worked. Here is an array of text values and their output below:
use Time::Piece;
#tz = ('', 'CDT+5', 'CST+5', 'FKU+5', 'XYZ+5', '+5', '+05', '+05.00',
'America/Chicago', 'America/Los_Angeles', 'CDT',
'CST', 'UTC', 'PDT', 'PST', '-01:00', '+01:00', '-05:00'.
'ACDT', 'EASST', '5000', '+0500', '+5:00', '+05:00', 'SSS+1', 'SSS+0',
'zzz-1', 'ZZ1+5', '123+5', '___+5', '/*&+5', , '/*&+05', '/*&+005',
'/*&+000000000005');
foreach $tz (#tz) {
$ENV{TZ} = $tz if $tz;
Time::Piece::_tzset() if $tz;
printf("T%s, ENV->TZ=%s\n", scalar localtime, $ENV{TZ} || 'NoTZ');
}
Most every try with anything but XXX . +|- . integer gave UTC, but many were an hour off for no reason (America/Los_Angeles and America/Chicago gave the same value). I am almost sure I used to get away with just CDT and CST, possibly on Activestate (switched to Strawberry to compile my own Perl modules rather than rely on Activestate for everything). This is the first major snarl.
I rebuilt DateTime from scratch and it worked fine. DateTime::TimeZone::Local::Win32 "failed for 'Win32::TieRegistry'"
Here's the sorted result of the attempted zones above:
P:\br1\sxsw.2015\sx-2015.0318\done>bb | sort
Running c:/bin/bb.pl Tue Apr 14 21:43:56 2015
TTue Apr 14 16:43:56 2015, ENV->TZ=/*&+000000000005
TTue Apr 14 16:43:56 2015, ENV->TZ=/*&+005
TTue Apr 14 16:43:56 2015, ENV->TZ=/*&+05
TTue Apr 14 16:43:56 2015, ENV->TZ=/*&+5
TTue Apr 14 16:43:56 2015, ENV->TZ=___+5
TTue Apr 14 16:43:56 2015, ENV->TZ=123+5
TTue Apr 14 16:43:56 2015, ENV->TZ=CDT+5
TTue Apr 14 16:43:56 2015, ENV->TZ=CST+5
TTue Apr 14 16:43:56 2015, ENV->TZ=FKU+5
TTue Apr 14 16:43:56 2015, ENV->TZ=XYZ+5
TTue Apr 14 16:43:56 2015, ENV->TZ=ZZ1+5
ABOVE ALL WORKED Below most failed with UTC or +1 hour???
TTue Apr 14 20:43:56 2015, ENV->TZ=SSS+1
TTue Apr 14 21:43:56 2015, ENV->TZ=-01:00
TTue Apr 14 21:43:56 2015, ENV->TZ=+01:00
TTue Apr 14 21:43:56 2015, ENV->TZ=+05
TTue Apr 14 21:43:56 2015, ENV->TZ=+05:00
TTue Apr 14 21:43:56 2015, ENV->TZ=+0500
TTue Apr 14 21:43:56 2015, ENV->TZ=+5
TTue Apr 14 21:43:56 2015, ENV->TZ=+5:00
TTue Apr 14 21:43:56 2015, ENV->TZ=5000
TTue Apr 14 21:43:56 2015, ENV->TZ=CDT
TTue Apr 14 21:43:56 2015, ENV->TZ=CDT
TTue Apr 14 21:43:56 2015, ENV->TZ=CST
TTue Apr 14 21:43:56 2015, ENV->TZ=PDT
TTue Apr 14 21:43:56 2015, ENV->TZ=PST
TTue Apr 14 21:43:56 2015, ENV->TZ=SSS+0
TTue Apr 14 21:43:56 2015, ENV->TZ=UTC
TTue Apr 14 22:43:56 2015, ENV->TZ=-05:00ACDT
TTue Apr 14 22:43:56 2015, ENV->TZ=+05.00
TTue Apr 14 22:43:56 2015, ENV->TZ=America/Chicago
TTue Apr 14 22:43:56 2015, ENV->TZ=America/Los_Angeles
TTue Apr 14 22:43:56 2015, ENV->TZ=EASST
TTue Apr 14 22:43:56 2015, ENV->TZ=zzz-1
Even after finding and installing the Holy Grail, the TzFile module for the Olsen Database, it is still screwed, no difference!
Installing C:\bin\strawberry_perl_5_18\perl\site\lib\DateTime\TimeZone\Tzfile.pm
ZEFRAM/DateTime-TimeZone-Tzfile-0.010.tar.gz
C:\bin\strawberry_perl_5_18\perl\bin\perl.exe ./Build install --uninst 1 -- OK
Here are all of the alleged timezones which do nothing on this platform from:
#atz = DateTime::TimeZone->all_names();
printf("All tz names [%d] = %s\n", scalar #atz, join(", ", #atz));
All tz names [349] = Africa/Abidjan, Africa/Accra, Africa/Algiers, Africa/Bissau, Africa/Cairo, Africa/Casablanca, Africa/Ceuta, Africa/El_Aaiun, Africa/Johannesburg, Africa/Khartoum, Africa/Lagos, Africa/Maputo, Africa/Monrovia, Africa/Nairobi, Africa/Ndjamena, Africa/Tripoli, Africa/Tunis, Africa/Windhoek, America/Adak, America/Anchorage, America/Araguaina, America/Argentina/Buenos_Aires, America/Argentina/Catamarca, America/Argentina/Cordoba, America/Argentina/Jujuy, America/Argentina/La_Rioja, America/Argentina/Mendoza, America/Argentina/Rio_Gallegos, America/Argentina/Salta, America/Argentina/San_Juan, America/Argentina/San_Luis, America/Argentina/Tucuman, America/Argentina/Ushuaia, America/Asuncion, America/Atikokan, America/Bahia, America/Bahia_Banderas, America/Barbados, America/Belem, America/Belize, America/Blanc-Sablon, America/Boa_Vista, America/Bogota, America/Boise, America/Cambridge_Bay, America/Campo_Grande, America/Cancun, America/Caracas, America/Cayenne, America/Chicago, America/Chihuahua, America/Costa_Rica, America/Creston, America/Cuiaba, America/Curacao, America/Danmarkshavn, America/Dawson, America/Dawson_Creek, America/Denver, America/Detroit, America/Edmonton, America/Eirunepe, America/El_Salvador, America/Fortaleza, America/Glace_Bay, America/Godthab, America/Goose_Bay, America/Grand_Turk, America/Guatemala, America/Guayaquil, America/Guyana, America/Halifax, America/Havana, America/Hermosillo, America/Indiana/Indianapolis, America/Indiana/Knox, America/Indiana/Marengo, America/Indiana/Petersburg, America/Indiana/Tell_City, America/Indiana/Vevay, America/Indiana/Vincennes, America/Indiana/Winamac, America/Inuvik, America/Iqaluit, America/Jamaica, America/Juneau, America/Kentucky/Louisville, America/Kentucky/Monticello, America/La_Paz, America/Lima, America/Los_Angeles, America/Maceio, America/Managua, America/Manaus, America/Martinique, America/Matamoros, America/Mazatlan, America/Menominee, America/Merida, America/Metlakatla, America/Mexico_City, America/Miquelon, America/Moncton, America/Monterrey, America/Montevideo, America/Montreal, America/Nassau, America/New_York, America/Nipigon, America/Nome, America/Noronha, America/North_Dakota/Beulah, America/North_Dakota/Center, America/North_Dakota/New_Salem, America/Ojinaga, America/Panama, America/Pangnirtung, America/Paramaribo, America/Phoenix, America/Port-au-Prince, America/Port_of_Spain, America/Porto_Velho, America/Puerto_Rico, America/Rainy_River, America/Rankin_Inlet, America/Recife, America/Regina, America/Resolute, America/Rio_Branco, America/Santa_Isabel, America/Santarem, America/Santiago, America/Santo_Domingo, America/Sao_Paulo, America/Scoresbysund, America/Sitka, America/St_Johns, America/Swift_Current, America/Tegucigalpa, America/Thule, America/Thunder_Bay, America/Tijuana, America/Toronto, America/Vancouver, America/Whitehorse, America/Winnipeg, America/Yakutat, America/Yellowknife, Antarctica/Casey, Antarctica/Davis, Antarctica/DumontDUrville, Antarctica/Macquarie, Antarctica/Mawson, Antarctica/Palmer, Antarctica/Rothera, Antarctica/Syowa, Antarctica/Troll, Antarctica/Vostok, Asia/Almaty, Asia/Amman, Asia/Anadyr, Asia/Aqtau, Asia/Aqtobe, Asia/Ashgabat, Asia/Baghdad, Asia/Baku, Asia/Bangkok, Asia/Beirut, Asia/Bishkek, Asia/Brunei, Asia/Chita, Asia/Choibalsan, Asia/Colombo, Asia/Damascus, Asia/Dhaka, Asia/Dili, Asia/Dubai, Asia/Dushanbe, Asia/Gaza, Asia/Hebron, Asia/Ho_Chi_Minh, Asia/Hong_Kong, Asia/Hovd, Asia/Irkutsk, Asia/Jakarta, Asia/Jayapura, Asia/Jerusalem, Asia/Kabul, Asia/Kamchatka, Asia/Karachi, Asia/Kathmandu, Asia/Khandyga, Asia/Kolkata, Asia/Krasnoyarsk, Asia/Kuala_Lumpur, Asia/Kuching, Asia/Macau, Asia/Magadan, Asia/Makassar, Asia/Manila, Asia/Nicosia, Asia/Novokuznetsk, Asia/Novosibirsk, Asia/Omsk, Asia/Oral, Asia/Pontianak, Asia/Pyongyang, Asia/Qatar, Asia/Qyzylorda, Asia/Rangoon, Asia/Riyadh, Asia/Sakhalin, Asia/Samarkand, Asia/Seoul, Asia/Shanghai, Asia/Singapore, Asia/Srednekolymsk, Asia/Taipei, Asia/Tashkent, Asia/Tbilisi, Asia/Tehran, Asia/Thimphu, Asia/Tokyo, Asia/Ulaanbaatar, Asia/Urumqi, Asia/Ust-Nera, Asia/Vladivostok, Asia/Yakutsk, Asia/Yekaterinburg, Asia/Yerevan, Atlantic/Azores, Atlantic/Bermuda, Atlantic/Canary, Atlantic/Cape_Verde, Atlantic/Faroe, Atlantic/Madeira, Atlantic/Reykjavik, Atlantic/South_Georgia, Atlantic/Stanley, Australia/Adelaide, Australia/Brisbane, Australia/Broken_Hill, Australia/Currie, Australia/Darwin, Australia/Eucla, Australia/Hobart, Australia/Lindeman, Australia/Lord_Howe, Australia/Melbourne, Australia/Perth, Australia/Sydney, CET, CST6CDT, EET, EST, EST5EDT, Europe/Amsterdam, Europe/Andorra, Europe/Athens, Europe/Belgrade, Europe/Berlin, Europe/Brussels, Europe/Bucharest, Europe/Budapest, Europe/Chisinau, Europe/Copenhagen, Europe/Dublin, Europe/Gibraltar, Europe/Helsinki, Europe/Istanbul, Europe/Kaliningrad, Europe/Kiev, Europe/Lisbon, Europe/London, Europe/Luxembourg, Europe/Madrid, Europe/Malta, Europe/Minsk, Europe/Monaco, Europe/Moscow, Europe/Oslo, Europe/Paris, Europe/Prague, Europe/Riga, Europe/Rome, Europe/Samara, Europe/Simferopol, Europe/Sofia, Europe/Stockholm, Europe/Tallinn, Europe/Tirane, Europe/Uzhgorod, Europe/Vienna, Europe/Vilnius, Europe/Volgograd, Europe/Warsaw, Europe/Zaporozhye, Europe/Zurich, HST, Indian/Chagos, Indian/Christmas, Indian/Cocos, Indian/Kerguelen, Indian/Mahe, Indian/Maldives, Indian/Mauritius, Indian/Reunion, MET, MST, MST7MDT, PST8PDT, Pacific/Apia, Pacific/Auckland, Pacific/Bougainville, Pacific/Chatham, Pacific/Chuuk, Pacific/Easter, Pacific/Efate, Pacific/Enderbury, Pacific/Fakaofo, Pacific/Fiji, Pacific/Funafuti, Pacific/Galapagos, Pacific/Gambier, Pacific/Guadalcanal, Pacific/Guam, Pacific/Honolulu, Pacific/Kiritimati, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, Pacific/Marquesas, Pacific/Nauru, Pacific/Niue, Pacific/Norfolk, Pacific/Noumea, Pacific/Pago_Pago, Pacific/Palau, Pacific/Pitcairn, Pacific/Pohnpei, Pacific/Port_Moresby, Pacific/Rarotonga, Pacific/Tahiti, Pacific/Tarawa, Pacific/Tongatapu, Pacific/Wake, Pacific/Wallis, UTC, WET