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

Re: [FWP] Real World Perl (2)



Before someone else points them out...


On Wed, Mar 21, 2001 at 11:41:22PM -0800, Neil Kandalgaonkar wrote:

> # incorrect for years below 1000. :)

# was always correct in all cases.
sub today3{sprintf("%d%02d%02d",(@_=(localtime)[5,4,3],$_[0]+=1900,$_[1]++,@_))}

# canonical, added use() and s/::/'/
sub today4{use POSIX;POSIX'strftime('%Y%m%d',localtime)}

-- 
Neil Kandalgaonkar
Web App Developer, ActiveState

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe