/* Calculates the date and time from a number of seconds since the epoch */ call rxfuncadd 'Sys2LoadFuncs', 'RXUTILEX', 'Sys2LoadFuncs' call Sys2LoadFuncs say '--------------------------------------------------------------------' SAY 'The current timezone is:' VALUE('TZ',,'OS2ENVIRONMENT') parse arg time_t if time_t == '' then do time_t = Sys2GetEpochTime() if SYS2ERR <> '0' THEN SAY SYS2ERR end say 'Calender (epoch) time is:' time_t say loc_time = Sys2FormatTime(time_t, 'l') if SYS2ERR <> '0' THEN SAY SYS2ERR utc_time = Sys2FormatTime(time_t, 'l', 'u') if SYS2ERR <> '0' THEN SAY SYS2ERR say 'Converted local time is "'loc_time'"' say 'Unconverted time is "'utc_time'"' call setlocal '@set TZ=JST-9' loc_time = Sys2FormatTime(time_t, 'l') if SYS2ERR <> '0' THEN SAY SYS2ERR say 'Converted Japan time is "'loc_time'"' call endlocal say say '--------------------------------------------------------------------' call setlocal CALL VALUE 'TZ', 'UTC0', 'OS2ENVIRONMENT' SAY 'The current timezone is:' VALUE('TZ',,'OS2ENVIRONMENT') time_t = Sys2GetEpochTime() if SYS2ERR <> '0' THEN SAY SYS2ERR say 'Calender (epoch) time is:' time_t say loc_time = Sys2FormatTime(time_t, 'l') if SYS2ERR <> '0' THEN SAY SYS2ERR utc_time = Sys2FormatTime(time_t, 'l', 'u') if SYS2ERR <> '0' THEN SAY SYS2ERR say 'Converted local time is "'loc_time'"' say 'Unconverted time is "'utc_time'"' '@set TZ=JST-9' loc_time = Sys2FormatTime(time_t, 'l') if SYS2ERR <> '0' THEN SAY SYS2ERR say 'Converted Japan time is "'loc_time'"' call endlocal CALL Sys2DropFuncs return 0