Comments for Epoch2Time
24 Aug 2007 00:49
Re: Epoc 2 date
> Or, on a recent distro
> (date --version
> date (GNU coreutils) 6.9)
>
> date -d @1177030963
>
>
>
> /me shrugs
>
>
>
>
Works fine (didn't know about that option), though man date doesn't seem to mention it.
24 Aug 2007 00:43
Re: Ummm, how does this differ from GNU date?
>
> I have to wonder, given the package's
> description, what this does that one
> can't simply accomplish with the
> following single line of shell
> scripting:
>
> date -d "$(( $(date +%s) -
> $EPOCH )) seconds ago"
> +"$DESIRED_DATE_FORMAT"
>
> Which the stock GNU date command, from
> coreutils, handles just fine (including
> for epoch values in the future, which
> naturally generate a negative number of
> "seconds ago" --- odd looking
> to a human, but reasonably handled by
> the software nonetheless).
>
> JimD
>
>
I didn't know about date -d @
It does nothing more then that.
22 Aug 2007 13:46
Epoc 2 date
Or, on a recent distro
(date --version
date (GNU coreutils) 6.9)
date -d @1177030963
/me shrugs
22 Aug 2007 13:02
Ummm, how does this differ from GNU date?
I have to wonder, given the package's description, what this does that one can't simply accomplish with the following single line of shell scripting:
date -d "$(( $(date +%s) - $EPOCH )) seconds ago" +"$DESIRED_DATE_FORMAT"
Which the stock GNU date command, from coreutils, handles just fine (including for epoch values in the future, which naturally generate a negative number of "seconds ago" --- odd looking to a human, but reasonably handled by the software nonetheless).
JimD
A financial fixed-income credit analytics, credit risk, bond analytics, and bond risk library.
Re: Ummm, how does this differ from GNU date?
Older versions of date do not support -d (Tested on my Debian Sarge production systems).