Re: Time conversion
On Wed, Dec 5, 2012, at 09:49 PM, Rod Whitworth wrote: > On Thu, 6 Dec 2012 11:55:37 +1300, m...@extensibl.com wrote: > > >On Thu, Dec 06, 2012 at 09:31:43AM +1100, Rod Whitworth wrote: > >> I think I'm suffering from OldTimers Disease ;-) > >> > >> I often have cause to use "date -r " to show me what the date stamp is > >> in human terms. > >> It is usually in spamd or on some documents I get that are time stamped > >> using the seconds since the epoc. > >> > >> Now I have a need to generate some timestamps of my own and, whilst I'm > >> sure I've done it in the past, I cannot remember it now. > >> > >> Cluebat? > >> > > > >date +%s --date="January 01, 1970 00:00 GMT" > > > > The "--" in there says you are running linux... this is an OpenBSD > list. When will people learn that GNU's not UNIX
Re: Time conversion
On Thu, 6 Dec 2012 11:55:37 +1300, m...@extensibl.com wrote: >On Thu, Dec 06, 2012 at 09:31:43AM +1100, Rod Whitworth wrote: >> I think I'm suffering from OldTimers Disease ;-) >> >> I often have cause to use "date -r " to show me what the date stamp is >> in human terms. >> It is usually in spamd or on some documents I get that are time stamped >> using the seconds since the epoc. >> >> Now I have a need to generate some timestamps of my own and, whilst I'm >> sure I've done it in the past, I cannot remember it now. >> >> Cluebat? >> > >date +%s --date="January 01, 1970 00:00 GMT" > The "--" in there says you are running linux... this is an OpenBSD list. 8-) *** NOTE *** Please DO NOT CC me. I subscribed to the list. Mail to the sender address that does not originate at the list server is tarpitted. The reply-to: address is provided for those who feel compelled to reply off list. Thankyou. Rod/ --- This life is not the real thing. It is not even in Beta. If it was, then OpenBSD would already have a man page for it.
Re: Time conversion
On Wed, 5 Dec 2012 23:47:32 +0100, Paul de Weerd wrote: >On Thu, Dec 06, 2012 at 09:31:43AM +1100, Rod Whitworth wrote: >| Cluebat? > >date +%s Ah yes. Reading the date man page won't do one any good unless you follow the pointer to strftime. Thanks for the wakeup which was the result of looking at your example code. *** NOTE *** Please DO NOT CC me. I subscribed to the list. Mail to the sender address that does not originate at the list server is tarpitted. The reply-to: address is provided for those who feel compelled to reply off list. Thankyou. Rod/ --- This life is not the real thing. It is not even in Beta. If it was, then OpenBSD would already have a man page for it.
Re: Time conversion
On Thu, Dec 06, 2012 at 11:55:37AM +1300, m...@extensibl.com wrote: | On Thu, Dec 06, 2012 at 09:31:43AM +1100, Rod Whitworth wrote: | > I think I'm suffering from OldTimers Disease ;-) | > | > I often have cause to use "date -r " to show me what the date stamp is | > in human terms. | > It is usually in spamd or on some documents I get that are time stamped | > using the seconds since the epoc. | > | > Now I have a need to generate some timestamps of my own and, whilst I'm | > sure I've done it in the past, I cannot remember it now. | > | > Cluebat? | > | | date +%s --date="January 01, 1970 00:00 GMT" This is not gnu date. If that's what you want, use -j and specify a date in ccyymmddHHMM.SS format: [weerd@despair] $ date -j +%s 201212052355.13 1354748113 Note that this is TZ dependant...: [weerd@despair] $ date -r 1354748113 Wed Dec 5 23:55:13 CET 2012 Paul 'WEiRD' de Weerd -- >[<++>-]<+++.>+++[<-->-]<.>+++[<+ +++>-]<.>++[<>-]<+.--.[-] http://www.weirdnet.nl/
Re: Time conversion
On Thu, Dec 06, 2012 at 09:31:43AM +1100, Rod Whitworth wrote: > I think I'm suffering from OldTimers Disease ;-) > > I often have cause to use "date -r " to show me what the date stamp is > in human terms. > It is usually in spamd or on some documents I get that are time stamped > using the seconds since the epoc. > > Now I have a need to generate some timestamps of my own and, whilst I'm > sure I've done it in the past, I cannot remember it now. > > Cluebat? > date +%s --date="January 01, 1970 00:00 GMT"
Re: Time conversion
On Thu, Dec 06, 2012 at 09:31:43AM +1100, Rod Whitworth wrote: | Cluebat? date +%s -- >[<++>-]<+++.>+++[<-->-]<.>+++[<+ +++>-]<.>++[<>-]<+.--.[-] http://www.weirdnet.nl/
Time conversion
I think I'm suffering from OldTimers Disease ;-) I often have cause to use "date -r " to show me what the date stamp is in human terms. It is usually in spamd or on some documents I get that are time stamped using the seconds since the epoc. Now I have a need to generate some timestamps of my own and, whilst I'm sure I've done it in the past, I cannot remember it now. Cluebat? Thanx, *** NOTE *** Please DO NOT CC me. I subscribed to the list. Mail to the sender address that does not originate at the list server is tarpitted. The reply-to: address is provided for those who feel compelled to reply off list. Thankyou. Rod/ --- This life is not the real thing. It is not even in Beta. If it was, then OpenBSD would already have a man page for it.