I wrote the below code and tested it out on different platforms. I got different results on HP-UX IA64,as compared to other platforms.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
time_t t;
struct tm *gmt, *lat, ldummy;
tzset();
printf("Local timezone: TZ=%s\n\n", getenv("TZ"));
t = 1394881705;
lat = localtime(&t);
printf("Local time is : %s", asctime(lat));
gmt = gmtime(&t);
printf("GMT is : %s", asctime(gmt));
return 0;
}
OUTPUT:-
Linux
$ ./a.out
Local timezone: TZ=CET
Local time is : Sat Mar 15 12:08:25 2014
GMT is : Sat Mar 15 11:08:25 2014
SunOs
$ ./a.out
Local timezone: TZ=CET
Local time is : Sat Mar 15 12:08:25 2014
GMT is : Sat Mar 15 11:08:25 2014
AIX
$ ./a.out
Local timezone: TZ=CET
Local time is : Sat Mar 15 12:08:25 2014
GMT is : Sat Mar 15 11:08:25 2014
(This is where the problem is) HP-UX IA64
$ ./a.out
Local timezone: TZ=CET
Local time is : Sat Mar 15 11:08:25 2014
GMT is : Sat Mar 15 11:08:25 2014
I am trying to understand why the output is differing in case of HP-UZ IA64(Version is 11.31). I could not find any relevant documentation for this eccentric behaviour. Would someone help me with understanding this?