Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Two digit year with DateTime?

by ikegami (Patriarch)
on Mar 12, 2019 at 00:24 UTC ( [id://1231141]=note: print w/replies, xml ) Need Help??


in reply to Two digit year with DateTime?

As an aside, DateTime->today() very likely incorrect because it doesn't return the local date. If you want the local date, you could use

DateTime->today( time_zone => 'local' )

However, that will fail on a day without midnight. The following is the correct approach is:

DateTime ->now( time_zone => 'local' ) ->set_time_zone('floating') ->truncate( to => 'day' )

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1231141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found