Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

RE: RE: Timezones in Perl

by Shendal (Hermit)
on Jun 22, 2000 at 23:44 UTC ( [id://19494]=note: print w/replies, xml ) Need Help??


in reply to RE: Timezones in Perl
in thread Timezones in Perl

I suppose you could use Date::Manip, but, by the module author's own comments, "It's big and slow." If all you want is to convert time zones, I think it's easy to write your own, your performance wouldn't suffer, and you wouldn't have to worry about weather or not Date::Manip is installed.

Replies are listed 'Best First'.
RE: RE: RE: Timezones in Perl
by lhoward (Vicar) on Jun 22, 2000 at 23:56 UTC
    Of course, if you do write your own code you will be spending time to re-implement something that someone has already written. If the overhead of calling a "slow" module like Date::Manip is too much for you, then Perl is probably too slow and inefficient for you; you should use a compiled language like C. Also Date::Manip (and all other perl modules) has been used by thousands of perl programmers, so the code is well tested and proven to be reliable, stable and relatively bug-free.
      Good points. I would still encourage writing your own routine, if all you need is different timezones -- it would be trivial. I know that I have to work on many varying machines all over, and the more modules I have to worry about installing the more of a headache it becomes (especially when you're talking about hundreds of NT clients).

      FWIW, I haven't noticed this package being "slow"... I'm merely pointing out that the author seems to think so.
        Time-zone conversion is not a trivial problem. If the from/to timezones are constant and you don't have any foolishness like "daylight savings time" to consider you could theoretically do a conversion by adding or subtracting n hours. However, what if that rolls over a day boundary? What about month boundaries? You have to consider years too. You also need to keep track of leap-years to be accurate. By the time you're done you've impelmented a good portion of a full calendar system just to do a timezone conversion. IMHO, much better to use a module.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found