@verb #24:"ctime" this none this rxdo #8084 @program #24:"ctime" this none this "Convert to a timezone, from server time. The timezones will be listed as the output of the '@tz' command with no argument." "Takes the arguments of: ([time[, tozone]]). Time can be either a number or a string in ctime()'s format. tozone should be a string representing a path to timezone information, ala 'Canada/Mountain'." {?time = time(), ?to = this.timezone_spec} = args if (typeof(time) == $STR) time = $time_utils:from_ctime(time) endif return ctime(time, to) "{?time = time(), ?to = this.timezone_spec, ?from = ctime()[$ - 2..$]} = args;" "oto = to;" "if (typeof(time) == $STR)" " time = $time_utils:from_ctime(time);" "endif" "if (typeof(to) == $STR)" " `to = listassoc(to, $time_utils.timezones)[2] ! E_RANGE => raise(E_INVARG, \"to time zone is not in $time_utils.timezones.\")';" "endif" "if (typeof(from) == $STR)" " `from = listassoc(from, $time_utils.timezones)[2] ! E_RANGE => raise(E_INVARG, \"from time zone is not in $time_utils.timezones.\")';" "endif" "add = from - to;" "time = time + (add * 3600);" "retval = strsub(ctime(time), ctime(time)[$ - 2..$], (typeof(oto) == $STR) ? $su:uppercase(oto) | tostr(ctime(time)[$ - 2..$], (add > 0) ? \"+\" | \"\", add));" "return retval;" "Last modified by Dax (#789) on Tue May 3 13:43:06 2005 MDT." .