in reply to Re^3: How can I convert epoch seconds to date format
in thread How can I convert epoch seconds to date format
This is the code I am using:i/p 31: req time is 2006-05-17 12:00:00 o/p should be: 431: date 1 is 2006-05-17 13:00:00 but the final value I get is 2006-05-23 14:00:00
Please let me know if anything is wrong with this....$req_time = got value from db; ($date,$time) = split(/ /, $req_time); ($year,$month,$day) = split(/-/, $date); ($hour,$min,$sec) = split(/:/, $time); $req_date = timelocal($sec, $min, $hour, $day, --$month, $year); $rtime = $req_date + 1*60*60; my $date1 = strftime '%Y-%m-%d %H:%M:%S', localtime $rtime;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How can I convert epoch seconds to date format
by davorg (Chancellor) on May 11, 2006 at 14:34 UTC |