diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index a4360280..f96a1bc1 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -8168,8 +8168,13 @@ static void init_registers() time_t #endif /* not LONG_FOR_TIME_T */ t = current_time(); - // Use struct here to work around misfeature in old versions of g++. - struct tm *tt = localtime(&t); + char *use_utc = getenv("GROFF_USE_UTC"); + struct tm *tt = 0; + if (use_utc) + tt = gmtime(&t); + else + tt = localtime(&t); + set_number_reg("seconds", int(tt->tm_sec)); set_number_reg("minutes", int(tt->tm_min)); set_number_reg("hours", int(tt->tm_hour));