You can just use the function 'localtime' to get a human readable time stamp.
Code:
# localtime can take parameters to manipulate the format $time = localtime; # no args print $time, "\n"; # will output something like: Fri Feb 2 06:45:57 2001 ## If you already have an epoch time you must convert do this $time = localtime( $epoch ); # this will convert your epoch time to the same format in the previous example
************************************************************************************************************************
$time = localtime( $epoch );
How could I go from a 10 digit epoch time stamp to a parsed out human readable time varables
$sec,$min,$hour,$mday,$mon,$year
************************************************************************************************************************
try this :
Code:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime( $epoch )
'Programming > Perl' 카테고리의 다른 글
[Perl] 반복 실행 - for, foreach, while, until (0) | 2014.01.29 |
---|---|
[Perl] Beginning Perl Tutorial - Installing and Using MySQL (0) | 2014.01.29 |
[Perl] Perl DBI examples for DBD::mysql (0) | 2014.01.29 |
[Perl] PERL - MySQL Query (0) | 2014.01.29 |
[Perl] Port Scanner (포트 스캐너) (0) | 2014.01.29 |
[Perl] Perl Convert Epoch to Human timestamp YYYY-MM-DD HH:MM:SS (0) | 2014.01.29 |
[Perl] How can I convert epoch seconds to date format (0) | 2014.01.29 |
[Perl] Perl Epoch Converter Routines (0) | 2014.01.29 |
[Perl] Formatting dates with strftime (0) | 2014.01.29 |
[Perl] Epoch Time(Unix Time) 구하는 방법 (0) | 2014.01.29 |