Re: converting dates to epoch seconds and back

2013-01-18 Thread John W. Krahn
Bill Stephenson wrote: When converting DMYHMS to Epoch Seconds and back I get cheated out of a day. Why? Bill -- #!/usr/bin/perl use strict; use warnings; use Time::Local; my ($time, $month, $day, $year, $seconds, $minutes, $hours, $wday, $yday, $isdst); my $start_date = '11/30/2012'; pr

Re: converting dates to epoch seconds and back

2013-01-18 Thread Dominik Danter
The output depends on the timezone that you have set on your machine. You can toy around and try different ones with $ENV{TZ} = 'Europe/Vienna'; or $ENV{TZ} = 'America/Los_Angeles'; If you don't want to depend on the timezone use gmtime instead of localtime. Bill Stephenson hat am 18. Januar 201

RE: converting dates to epoch seconds and back

2013-01-18 Thread twlewis
Bill, it appears to have to do with it pick the time not being populated, and it picking up the date from yesterday. I added some lines to test this theory. Try running the code below without an argument, and then with an argument. Tim #!/usr/bin/perl use strict; use warnings; use Time::Loc

converting dates to epoch seconds and back

2013-01-18 Thread Bill Stephenson
When converting DMYHMS to Epoch Seconds and back I get cheated out of a day. Why? Bill -- #!/usr/bin/perl use strict; use warnings; use Time::Local; my ($time, $month, $day, $year, $seconds, $minutes, $hours, $wday, $yday, $isdst); my $start_date = '11/30/2012'; print "$start_date \n"; ($