HFX Forum

Programming => PERL => Topic started by: pzqwpo on May 07, 2009, 08:35:02 PM

Title: How to get local time using PERL?
Post by: pzqwpo on May 07, 2009, 08:35:02 PM
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?
Title: Re: How to get local time using PERL?
Post by: benthehutt on May 08, 2009, 11:59:18 AM
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.