BreadCrumbs: Linux Time

Linux Time

From Luke Jackson

Revision as of 14:15, 5 December 2007; Ljackson (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search

Convert Unix Timstamp

Sometimes a program/tool prints its time information in unix timestamps. Unix timestamps are the seconds after 01/01/1970. This is usually unreadable by humans.

To convert this timestamp into something readable, copy the following small script into a searchable path and make it executable.

#!/bin/awk -f   
{ print strftime("%c", $0); }
</pre

Call the tool with the following command:

 echo "your timestamp" | scriptname

You'll get an response according to your local timezone.
Example:

<pre>
$ date +%s   
1098181096   
$ echo "1098181096" | convertunixtime   
Tue Oct 19 12:18:16 2004

Sources

Personal tools