Xref: utzoo news.admin:8139 news.software.b:4005 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!uwm.edu!rpi!tale From: tale@cs.rpi.edu (David C Lawrence) Newsgroups: news.admin,news.software.b Subject: Re: Dates in C-news Message-ID: Date: 24 Jan 90 03:00:36 GMT References: <1556@fallst.UUCP> <1314@ursa-major.SPDCC.COM> <4831b2fb.bfe8@tachyon.engin.umich.edu> <1990Jan23.175245.18937@iwarp.intel.com> Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 50 Randal Schwartz wrote: > I can write you a Perl program to translate it back, if you insist. Y'know, as soon as I saw RandalL's name on that article I knew he was going to offer a perl solution. In flee@shire.cs.psu.edu (Felix Lee) writes: > Conversely, you can use > $NEWSBIN/getdate now 'now -1 day' > to find out that it's now 633139077, and yesterday was 633052677. Yes, you can. That isn't always completely helpful though. Sometime last month someone asked me when a group here was created. I think it was alt.folklore.computers. Well, active.times told me it was created at 628900369. Using the getdate approach I'd have to make a couple of guesses to narrow it down a little and even then I'd have to spend some extra time if I wanted to make it really accurate. So I just threw this trivial excuse for a programme in $NEWSBIN/maint/undate and have found it handy when looking at a couple of times stored by C News. Error is checking is non-existent -- non-numeric arguments all just get turned into 0 by atol() and give you back the beginning of the Unix epoch. I don't really care; works just fine for my needs. -- #include #include int main (argc, argv) int argc; char **argv; { extern long atol(); long clock; if (!--argc) { (void)fprintf(stderr,"Usage: %s seconds_since_unix_epoch [...]\n",argv[0]); exit(1); } while (argc--) { clock = atol(*++argv); (void)fputs(ctime(&clock), stdout); } exit(0); }