On 21/04/2011 10:52, shawn wilson wrote:
On Apr 21/04/2011 5:38 cc wrote:
In PHP, there's strtotime(), but there isn't one in Perl that I can
find.
Why would I want to bloated my core to mess with dates when half of
what I do doesn't need that functionality?
Because the 'bloat' is very tiny, and most Perl implementations won't
load unneccessary inbuilt calls.
The string format is: mm/dd/yyyy hh:mm:ss
Most of the world observes dd/mm/yyyy. There is no reason to assume
otherwise unless you have a solely US distribution. Even then you must
worry more about units of length, volume and money.
If its always in that format, just split and define a hash and pass
it to dt. Otherwise, use dt:format:natural.
I don't understand why you are abbreviating package names when even the
capitalisation is so critical to the proper functioning of the program.
You mean:
DateTime::Format::Natural
So if t1 and t2 are of the aforementioned format, I just do a t2 -
t1 and it should give me the # of hours between the two datetimes.
As stated in the doc, dt overloads the variables so that you can do
that easy enough.
DateTime overloads the operators, not the variables.
Is there a function that can do this?
I don't think there is much to do with time and dates that dt (or
other modules under that namespace) can't handle.
I agree. DateTime is probably the answer, but I think you are misleading
people by referring to
dt (or other modules under that namespace)
which makes no sense at all.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/