return gmtime(&t);
}
-static struct tm *time_to_tm_local(unsigned long time)
++static struct tm *time_to_tm_local(timestamp_t time)
+ {
+ time_t t = time;
+ return localtime(&t);
+ }
+
/*
* What value of "tz" was in effect back then at "time" in the
* local timezone?
check_show raw-local "$TIME" '1466000000 +0000'
check_show unix-local "$TIME" '1466000000'
+ check_show 'format:%z' "$TIME" '+0200'
+ check_show 'format-local:%z' "$TIME" '+0000'
+ check_show 'format:%Z' "$TIME" ''
+ check_show 'format-local:%Z' "$TIME" 'UTC'
+ check_show 'format:%%z' "$TIME" '%z'
+ check_show 'format-local:%%z' "$TIME" '%z'
+
+ check_show 'format:%Y-%m-%d %H:%M:%S' "$TIME" '2016-06-15 16:13:20'
+ check_show 'format-local:%Y-%m-%d %H:%M:%S' "$TIME" '2016-06-15 09:13:20' '' EST5
+
# arbitrary time absurdly far in the future
FUTURE="5758122296 -0400"
-check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400" LONG_IS_64BIT
-check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000" LONG_IS_64BIT
+check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400" TIME_IS_64BIT,TIME_T_IS_64BIT
+check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000" TIME_IS_64BIT,TIME_T_IS_64BIT
check_parse() {
echo "$1 -> $2" >expect