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.