I use strftime
to format the time. %Z
format the time timezone. But the result is GMT compiled with arm-linux-gnueabihf-gcc
, UTC compiled with mipsel-openwrt-linux-uclibc-gcc
.
I don't know why.
time_t t = time(NULL);
char stat_timestamp[24] = {0};
strftime(stat_timestamp, sizeof stat_timestamp, "%F %T %Z", gmtime(&t));
printf("gmtime: %s\n", stat_timestamp);
compiled with arm-linux-gnueabihf-gcc
:
gmtime: 2018-12-21 XX:XX:XX GMT
compiled with mipsel-openwrt-linux-uclibc-gcc
:
gmtime: 2018-12-21 XX:XX:XX UTC