On Sun, 06 Aug 2000 13:10:23 -0700, Nathan Wiger wrote: >With the new date function you'll never need >> to call >> >> sprintf("%02d/%02d/%04d", $tm[3], $tm[4]+1, $tm[5]+1900); >> >> since you can do >> >> date(undef,"%d/%m/%Y") > >True, but notice that you have to specify a format. >> Also, why not space-pad the mday? > >Actually, given what I just said above - good point! This is actually a >whole issue by itself. Here's the question: how should day/month/year >look: > > 02/05/0982 # 0-padded > 2/5/982 # not 0-padded > >Geez, I can really see it both ways (although I probably prefer the >former because it's easier to work with). You can adapt some stuff from (s)printf: date(undef,"%02d/%02m/%Y") zero padded date(undef,"%2d/%2m/%Y") space padded date(undef,"%d/%m/%Y") not padded We should give an option of using 4 or 2 digit years. Or 3, for the truely bizarre... ;-) > $backup_suffix = join '', ((date)[0..6]); > >This is why I think 0-padding is invaluable. I like that. Only, zero padding should not be done if an explicit format is given, as above. -- Bart.
- Re: RFC 48 (v1) Replace loca... Philip Newton
- Re: RFC 48 (v1) Replace loca... Tim Jenness
- Re: RFC 48 (v1) Replace loca... Andy Dougherty
- Re: RFC 48 (v1) Replace loca... Jonathan Scott Duff
- Re: RFC 48 (v1) Replace loca... Dan Sugalski
- Re: RFC 48 (v1) Replace localtim... Glenn Linderman
- Re: RFC 48 (v1) Replace localtime() and gmtime() ... Nathan Wiger
- Re: RFC 48 (v1) Replace localtime() and gmtim... Jonathan Scott Duff
- Re: RFC 48 (v1) Replace localtime() and gmtim... Johan Vromans
- Re: RFC 48 (v1) Replace localtime() and g... Andy Dougherty
- Re: RFC 48 (v1) Replace localtime() and gmtim... Bart Lateur
- Re: RFC 48 (v1) Replace localtime() and gmtime() ... Gisle Aas
- Re: RFC 48 (v1) Replace localtime() and gmtim... Bryan C . Warnock
- Re: RFC 48 (v1) Replace localtime() and gmtim... Nathan Wiger
- Re: RFC 48 (v1) Replace localtime() and gmtime() with ... Russ Allbery
- Re: RFC 48 (v1) Replace localtime() and gmtime() ... Jonathan Scott Duff
- Re: RFC 48 (v1) Replace localtime() and gmtime() ... Jarkko Hietaniemi
- Re: RFC 48 (v1) Replace localtime() and gmtime() with ... Damian Conway
- Re: RFC 48 (v1) Replace localtime() and gmtime() ... Nathan Wiger
- Re: RFC 48 (v1) Replace localtime() and gmtime() ... Bart Lateur