Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
You want to convert epoch into readable date and time. Maybe you have a log file, which is pumping out lines prefixed with the epoch?
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
We use the perl function localtime to convert epoch into a date and time. At the example tab is the code to convert that epoch, into a recognizable date and time. localtime, can also return an array - take a look at the reference tag for more info.
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
We quite simply supply the epoch to localtime and print it. $ perl -e 'print localtime(1145980815)."\n";' Wed Apr 26 00:00:15 2006
|
Leave a Reply