diff options
| author | Lars Ingebrigtsen | 2019-07-29 14:15:03 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-29 14:22:38 +0200 |
| commit | 6cfda69d72cb9debefc48d0d95e341d389e7303a (patch) | |
| tree | 031f4d820ab5a0113f25a4d9096c0c5fde98499d /src | |
| parent | e4f957fb0794b5616deb0abf792e11132c06e3a9 (diff) | |
| download | emacs-6cfda69d72cb9debefc48d0d95e341d389e7303a.tar.gz emacs-6cfda69d72cb9debefc48d0d95e341d389e7303a.zip | |
Add support for dealing with decoded time structures
* doc/lispref/os.texi (Time Conversion): Document the new
functions that work on decoded time.
(Time Calculations): Document new date/time functions.
* lisp/simple.el (decoded-time-second, decoded-time-minute)
(decoded-time-hour, decoded-time-day, decoded-time-month)
(decoded-time-year, decoded-time-weekday, decoded-time-dst)
(decoded-time-zone): New accessor functions for decoded time values.
* lisp/calendar/time-date.el (date-days-in-month)
(date-ordinal-to-time): New functions.
(decoded-time--alter-month, decoded-time--alter-day)
(decoded-time--alter-second, make-decoded-time): New functions
added to manipulate decoded time structures.
* src/timefns.c (Fdecode_time): Mention the new accessors.
* test/lisp/calendar/time-date-tests.el: New file to test the
decoded time functions and the other new functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/timefns.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timefns.c b/src/timefns.c index 3b7ed460222..cce9dd51ba9 100644 --- a/src/timefns.c +++ b/src/timefns.c | |||
| @@ -1326,6 +1326,12 @@ the TZ environment variable. It can also be a list (as from | |||
| 1326 | `current-time-zone') or an integer (the UTC offset in seconds) applied | 1326 | `current-time-zone') or an integer (the UTC offset in seconds) applied |
| 1327 | without consideration for daylight saving time. | 1327 | without consideration for daylight saving time. |
| 1328 | 1328 | ||
| 1329 | To access (or alter) the elements in the time value, the | ||
| 1330 | `decoded-time-second', `decoded-time-minute', `decoded-time-hour', | ||
| 1331 | `decoded-time-day', `decoded-time-month', `decoded-time-year', | ||
| 1332 | `decoded-time-weekday', `decoded-time-dst' and `decoded-time-zone' | ||
| 1333 | accessors can be used. | ||
| 1334 | |||
| 1329 | The list has the following nine members: SEC is an integer between 0 | 1335 | The list has the following nine members: SEC is an integer between 0 |
| 1330 | and 60; SEC is 60 for a leap second, which only some operating systems | 1336 | and 60; SEC is 60 for a leap second, which only some operating systems |
| 1331 | support. MINUTE is an integer between 0 and 59. HOUR is an integer | 1337 | support. MINUTE is an integer between 0 and 59. HOUR is an integer |