# HG changeset patch # User Aidan Kehoe # Date 1347828201 -3600 # Node ID aa5f38ecb804ee655969c0f617ff5c50415ae3f7 # Parent 0eb4e96fd261faa9079b4b6fef400815d660883a Accept GNU's UNIVERSAL argument to #'format-time-string. src/ChangeLog addition: 2012-09-16 Aidan Kehoe * editfns.c (Fformat_time_string): Accept GNU's UNIVERSAL argument, which means we call gmtime() instead of localtime(). Thanks for the report of org-mode incompatibility, Matsl! diff -r 0eb4e96fd261 -r aa5f38ecb804 src/ChangeLog --- a/src/ChangeLog Sat Sep 08 16:33:48 2012 +0100 +++ b/src/ChangeLog Sun Sep 16 21:43:21 2012 +0100 @@ -1,3 +1,10 @@ +2012-09-16 Aidan Kehoe + + * editfns.c (Fformat_time_string): + Accept GNU's UNIVERSAL argument, which means we call gmtime() + instead of localtime(). Thanks for the report of org-mode + incompatibility, Matsl! + 2012-09-07 Aidan Kehoe * file-coding.c: diff -r 0eb4e96fd261 -r aa5f38ecb804 src/editfns.c --- a/src/editfns.c Sat Sep 08 16:33:48 2012 +0100 +++ b/src/editfns.c Sun Sep 16 21:43:21 2012 +0100 @@ -998,11 +998,13 @@ static long difftm (const struct tm *a, const struct tm *b); -DEFUN ("format-time-string", Fformat_time_string, 1, 2, 0, /* +DEFUN ("format-time-string", Fformat_time_string, 1, 3, 0, /* Use FORMAT-STRING to format the time TIME. TIME is specified as (HIGH LOW . IGNORED) or (HIGH . LOW), as from `current-time' and `file-attributes'. If TIME is not specified it defaults to the current time. +The third, optional, argument UNIVERSAL, if non-nil, means describe TIME +as Universal Time; nil means describe TIME in the local time zone. FORMAT-STRING may contain %-sequences to substitute parts of the time. %a is replaced by the abbreviated name of the day of week. %A is replaced by the full name of the day of week. @@ -1047,7 +1049,7 @@ The number of options reflects the `strftime' function. */ - (format_string, time_)) + (format_string, time_, universal)) { time_t value; Bytecount size; @@ -1065,7 +1067,7 @@ Extbyte *buf = alloca_extbytes (size); Extbyte *formext; /* make a copy of the static buffer returned by localtime() */ - struct tm tm = *localtime (&value); + struct tm tm = NILP (universal) ? *localtime (&value) : *gmtime (&value); *buf = 1;