comparison src/editfns.c @ 56386:4f00fbfe3c1e

(Ffloat_time, Fformat_time_string, Fdecode_time) (Fcurrent_time_string, Fcurrent_time_zone): Mention in docstrings that time values of the type (HIGH . LOW) are considered obsolete.
author Luc Teirlinck <teirllm@auburn.edu>
date Fri, 09 Jul 2004 23:34:28 +0000
parents e1f0d4beb4ba
children 1a84eb100ef3 029a652ac817
comparison
equal deleted inserted replaced
56385:eef1aaabd675 56386:4f00fbfe3c1e
1429 } 1429 }
1430 1430
1431 DEFUN ("float-time", Ffloat_time, Sfloat_time, 0, 1, 0, 1431 DEFUN ("float-time", Ffloat_time, Sfloat_time, 0, 1, 0,
1432 doc: /* Return the current time, as a float number of seconds since the epoch. 1432 doc: /* Return the current time, as a float number of seconds since the epoch.
1433 If SPECIFIED-TIME is given, it is the time to convert to float 1433 If SPECIFIED-TIME is given, it is the time to convert to float
1434 instead of the current time. The argument should have the forms: 1434 instead of the current time. The argument should have the form
1435 (HIGH . LOW) or (HIGH LOW USEC) or (HIGH LOW . USEC). 1435 (HIGH LOW . IGNORED). Thus, you can use times obtained from
1436 Thus, you can use times obtained from `current-time' 1436 `current-time' and from `file-attributes'. SPECIFIED-TIME can also
1437 and from `file-attributes'. 1437 have the form (HIGH . LOW), but this is considered obsolete.
1438 1438
1439 WARNING: Since the result is floating point, it may not be exact. 1439 WARNING: Since the result is floating point, it may not be exact.
1440 Do not use this function if precise time stamps are required. */) 1440 Do not use this function if precise time stamps are required. */)
1441 (specified_time) 1441 (specified_time)
1442 Lisp_Object specified_time; 1442 Lisp_Object specified_time;
1504 } 1504 }
1505 } 1505 }
1506 1506
1507 DEFUN ("format-time-string", Fformat_time_string, Sformat_time_string, 1, 3, 0, 1507 DEFUN ("format-time-string", Fformat_time_string, Sformat_time_string, 1, 3, 0,
1508 doc: /* Use FORMAT-STRING to format the time TIME, or now if omitted. 1508 doc: /* Use FORMAT-STRING to format the time TIME, or now if omitted.
1509 TIME is specified as (HIGH LOW . IGNORED) or (HIGH . LOW), as returned by 1509 TIME is specified as (HIGH LOW . IGNORED), as returned by
1510 `current-time' or `file-attributes'. 1510 `current-time' or `file-attributes'. The obsolete form (HIGH . LOW)
1511 is also still accepted.
1511 The third, optional, argument UNIVERSAL, if non-nil, means describe TIME 1512 The third, optional, argument UNIVERSAL, if non-nil, means describe TIME
1512 as Universal Time; nil means describe TIME in the local time zone. 1513 as Universal Time; nil means describe TIME in the local time zone.
1513 The value is a copy of FORMAT-STRING, but with certain constructs replaced 1514 The value is a copy of FORMAT-STRING, but with certain constructs replaced
1514 by text that describes the specified date and time in TIME: 1515 by text that describes the specified date and time in TIME:
1515 1516
1601 } 1602 }
1602 } 1603 }
1603 1604
1604 DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 1, 0, 1605 DEFUN ("decode-time", Fdecode_time, Sdecode_time, 0, 1, 0,
1605 doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW DST ZONE). 1606 doc: /* Decode a time value as (SEC MINUTE HOUR DAY MONTH YEAR DOW DST ZONE).
1606 The optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED) 1607 The optional SPECIFIED-TIME should be a list of (HIGH LOW . IGNORED),
1607 or (HIGH . LOW), as from `current-time' and `file-attributes', or `nil' 1608 as from `current-time' and `file-attributes', or `nil' to use the
1608 to use the current time. The list has the following nine members: 1609 current time. The obsolete form (HIGH . LOW) is also still accepted.
1609 SEC is an integer between 0 and 60; SEC is 60 for a leap second, which 1610 The list has the following nine members: SEC is an integer between 0
1610 only some operating systems support. MINUTE is an integer between 0 and 59. 1611 and 60; SEC is 60 for a leap second, which only some operating systems
1611 HOUR is an integer between 0 and 23. DAY is an integer between 1 and 31. 1612 support. MINUTE is an integer between 0 and 59. HOUR is an integer
1612 MONTH is an integer between 1 and 12. YEAR is an integer indicating the 1613 between 0 and 23. DAY is an integer between 1 and 31. MONTH is an
1613 four-digit year. DOW is the day of week, an integer between 0 and 6, where 1614 integer between 1 and 12. YEAR is an integer indicating the
1614 0 is Sunday. DST is t if daylight savings time is effect, otherwise nil. 1615 four-digit year. DOW is the day of week, an integer between 0 and 6,
1615 ZONE is an integer indicating the number of seconds east of Greenwich. 1616 where 0 is Sunday. DST is t if daylight savings time is effect,
1616 (Note that Common Lisp has different meanings for DOW and ZONE.) */) 1617 otherwise nil. ZONE is an integer indicating the number of seconds
1618 east of Greenwich. (Note that Common Lisp has different meanings for
1619 DOW and ZONE.) */)
1617 (specified_time) 1620 (specified_time)
1618 Lisp_Object specified_time; 1621 Lisp_Object specified_time;
1619 { 1622 {
1620 time_t time_spec; 1623 time_t time_spec;
1621 struct tm save_tm; 1624 struct tm save_tm;
1743 since the number of columns in each field is fixed. 1746 since the number of columns in each field is fixed.
1744 The format is `Sun Sep 16 01:03:52 1973'. 1747 The format is `Sun Sep 16 01:03:52 1973'.
1745 However, see also the functions `decode-time' and `format-time-string' 1748 However, see also the functions `decode-time' and `format-time-string'
1746 which provide a much more powerful and general facility. 1749 which provide a much more powerful and general facility.
1747 1750
1748 If SPECIFIED-TIME is given, it is a time to format instead 1751 If SPECIFIED-TIME is given, it is a time to format instead of the
1749 of the current time. The argument should have the form: 1752 current time. The argument should have the form (HIGH LOW . IGNORED).
1750 (HIGH . LOW) 1753 Thus, you can use times obtained from `current-time' and from
1751 or the form: 1754 `file-attributes'. SPECIFIED-TIME can also have the form (HIGH . LOW),
1752 (HIGH LOW . IGNORED). 1755 but this is considered obsolete. */)
1753 Thus, you can use times obtained from `current-time'
1754 and from `file-attributes'. */)
1755 (specified_time) 1756 (specified_time)
1756 Lisp_Object specified_time; 1757 Lisp_Object specified_time;
1757 { 1758 {
1758 time_t value; 1759 time_t value;
1759 char buf[30]; 1760 char buf[30];
1800 This returns a list of the form (OFFSET NAME). 1801 This returns a list of the form (OFFSET NAME).
1801 OFFSET is an integer number of seconds ahead of UTC (east of Greenwich). 1802 OFFSET is an integer number of seconds ahead of UTC (east of Greenwich).
1802 A negative value means west of Greenwich. 1803 A negative value means west of Greenwich.
1803 NAME is a string giving the name of the time zone. 1804 NAME is a string giving the name of the time zone.
1804 If SPECIFIED-TIME is given, the time zone offset is determined from it 1805 If SPECIFIED-TIME is given, the time zone offset is determined from it
1805 instead of using the current time. The argument should have the form: 1806 instead of using the current time. The argument should have the form
1806 (HIGH . LOW) 1807 (HIGH LOW . IGNORED). Thus, you can use times obtained from
1807 or the form: 1808 `current-time' and from `file-attributes'. SPECIFIED-TIME can also
1808 (HIGH LOW . IGNORED). 1809 have the form (HIGH . LOW), but this is considered obsolete.
1809 Thus, you can use times obtained from `current-time'
1810 and from `file-attributes'.
1811 1810
1812 Some operating systems cannot provide all this information to Emacs; 1811 Some operating systems cannot provide all this information to Emacs;
1813 in this case, `current-time-zone' returns a list containing nil for 1812 in this case, `current-time-zone' returns a list containing nil for
1814 the data it can't find. */) 1813 the data it can't find. */)
1815 (specified_time) 1814 (specified_time)