Diary of a geek

June 2008
Mon Tue Wed Thu Fri Sat Sun
           
5
           

Andrew Pollock

Categories

Other people's blogs

Subscribe

RSS feed

Contact me

JavaScript required


Thursday, 05 June 2008

On the date(1) command and seconds since 1970

Russell Coker wrote something about converting between timestamps since the epoch and human-readable dates.

I haven't fully parsed his post because I'm still half asleep, but I feel the need to point out the @ operator that I discovered last year in newer versions of GNU coreutils.

apollock@icarus:~$ date +%s
1212672691
apollock@icarus:~$ date -d @$(date +%s)
Thu Jun  5 06:31:50 PDT 2008

It seems a bit shorter than what Russell was using, and presumably does the same thing.

[06:38] [tech] [permalink]