comparison src/editfns.c @ 2976:6fe71a039fce

(Fcurrent_time_zone): Assign gmt, instead of init.
author Richard M. Stallman <rms@gnu.org>
date Sun, 23 May 1993 18:04:25 +0000
parents 79314d830f7d
children b087b4fd6066
comparison
equal deleted inserted replaced
2975:11c21b4d400d 2976:6fe71a039fce
632 (HIGH LOW . IGNORED).\n\ 632 (HIGH LOW . IGNORED).\n\
633 Thus, you can use times obtained from `current-time'\n\ 633 Thus, you can use times obtained from `current-time'\n\
634 and from `file-attributes'.\n\ 634 and from `file-attributes'.\n\
635 \n\ 635 \n\
636 Some operating systems cannot provide all this information to Emacs;\n\ 636 Some operating systems cannot provide all this information to Emacs;\n\
637 in this case, current-time-zone will return a list containing nil for\n\ 637 in this case, `current-time-zone' returns a list containing nil for\n\
638 the data it can't find.") 638 the data it can't find.")
639 (specified_time) 639 (specified_time)
640 Lisp_Object specified_time; 640 Lisp_Object specified_time;
641 { 641 {
642 time_t value; 642 time_t value;
643 struct tm *t; 643 struct tm *t;
644 644
645 if (lisp_time_argument (specified_time, &value) 645 if (lisp_time_argument (specified_time, &value)
646 && (t = gmtime(&value)) != 0) 646 && (t = gmtime (&value)) != 0)
647 { 647 {
648 struct tm gmt = *t; /* Make a copy, in case localtime modifies *t. */ 648 struct tm gmt;
649 long offset; 649 long offset;
650 char *s, buf[6]; 650 char *s, buf[6];
651 t = localtime(&value); 651
652 offset = difftm(t, &gmt); 652 gmt = *t; /* Make a copy, in case localtime modifies *t. */
653 t = localtime (&value);
654 offset = difftm (t, &gmt);
653 s = 0; 655 s = 0;
654 #ifdef HAVE_TM_ZONE 656 #ifdef HAVE_TM_ZONE
655 if (t->tm_zone) 657 if (t->tm_zone)
656 s = t->tm_zone; 658 s = t->tm_zone;
657 #endif 659 #endif