[DGD] Re: ctime() bug or feature?

Erwin Harte harte at is-here.com
Sun Feb 8 16:13:18 CET 2004


On Sun, Feb 08, 2004 at 10:05:36AM -0500, Michael McKiel wrote:
>  --- Par Winzell <zell at skotos.net> :
> > 
> >    sscanf(ctime(time()), "%s %s %d %d:%d:%d %d",
> >           dayname, monthname, day, hour, minute, second, year)
> > 
> > will -always- succeed and return 7, filling in all the variables with 
> > good values. I honestly don't understand how that space can possibly 
> > bother you. :)
> > 
> > Zell
> > 
> 
> But..but explode was so much more fun and didn't use a gazillion variables :)

So then only pick out the one you need:

   sscanf(ctime(time()), "%*s %*s %d %*d:%*d:%*d %*d", day);

Cheers,

Erwin.
-- 
Erwin Harte <harte at is-here.com>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list