How to get local time using PERL?

Started by pzqwpo, May 07, 2009, 08:35:02 PM

Previous topic - Next topic
How to get local time using PERL while the server I am using is in a different time zone? For example, my local time is 9 am August 17th. But the server is in 9pm August 16th time zone. How do I write PERL code to get my local time?

The easiest way is to use gmtime, which returns Greenwich mean time, i.e. with no daylight savings. Then go to http://wwp.greenwichmeantime.com/ and select your nation. It will tell you the difference between your time and Greenwich mean time. You just add the correct amount of hours and you're good to go.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.

SMF spam blocked by CleanTalk