bash script to convert date seconds back to date format..

Robert F. Chapman robert_chapman at maximhq.com
Thu Aug 16 07:56:12 UTC 2007


Depending on the version of date you have installed, you can use the
following syntax.

> date --date=@1187249220

Thu Aug 16 00:27:00 PDT 2007

Im not sure when the feature was added, but I remember seeing it used
this way quite some time ago.

---
Robert

On Thu, 2007-08-16 at 00:21 -0700, bruce wrote:
> fair enough....
> 
> #/bin/bash
> 
> #gets the epoch secs
> time=$(date -%s)
> 
> #convert back
> tstart=$(date -d $start +%H:%M:%S:)"
> 
> the above was from a website, although i've yet to get it to work...
> 
> 
> 
> 
> -----Original Message-----
> From: fedora-list-bounces at redhat.com
> [mailto:fedora-list-bounces at redhat.com]On Behalf Of Ed Greshko
> Sent: Wednesday, August 15, 2007 11:41 PM
> To: For users of Fedora
> Subject: Re: bash script to convert date seconds back to date format..
> 
> 
> bruce wrote:
> > hi....
> > 
> > after perusing the web...
> > 
> > i'm trying to figure out just how to create a bash script, that will get
> > date/epoch seconds, and convert the seconds back to a date format...
> > 
> > for some reason.. i'm missing something!!
> 
> Sometimes telling people what you've done so far will go a long way to them
> pointing out where you are missing something.  Otherwise, they will just be
> doing the work for you and plenty of people have better things to do.  :-)
> 
> -- 
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
> 
> 




More information about the users mailing list