Time Conversion
Our Sun Solaris 10 machine is configured to use Hong Kong TimeZone and we are necessary to convert the currect time from HK time to NY Eastern Time in our application. Normally, we used the following codes to do so on Sun Solaris 8 and it works:
export TZ="/usr/share/lib/zoneinfo/US/Eastern"
/usr/bin/perl -e 'printf "%s\n",scalar localtime()'
But it did not work on Sun Solaris 10 (the NYT should be 13 hours lagging behind HKT)
On Sun Solaris 8 (correct):
server1:/usr/appadm >date
Fri Dec 8 16:34:02 CST 2006
server1:/usr/appadm >export TZ="/usr/share/lib/zoneinfo/US/Eastern"
server1:/usr/appadm >/usr/bin/perl -e 'printf "%s\n",scalar localtime()'
Fri Dec 8 03:34:09 2006
server1:/usr/appadm >
On Sun Solaris 10 (incorrect):
server1:/usr/appadm >date
Fri Dec 8 16:35:29 HKT 2006
server1:/usr/appadm >export TZ="/usr/share/lib/zoneinfo/US/Eastern"
server1:/usr/appadm >/usr/bin/perl -e 'printf "%s\n",scalar localtime()'
Fri Dec 8 08:35:37 2006
server1:/usr/appadm >
Anyone knows how to achieve it?

