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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert F. Chapman wrote:
> 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.

Along with that....

> On Thu, 2007-08-16 at 00:21 -0700, bruce wrote:
>> fair enough....
>>
>> #/bin/bash
>>
>> #gets the epoch secs
>> time=$(date -%s)

Should read:

time=$(date +%s)

>> #convert back
>> tstart=$(date -d $start +%H:%M:%S:)"

Can be....

tstart=$(date --date=@$time +%H:%M:%S:)

The script doesn't define "$start" to begin with.  (What that a pun?)

>> the above was from a website, although i've yet to get it to work...

I could understand that.  Looks like the person posting never did read the
man page for "date".


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux