summaryrefslogtreecommitdiff
path: root/doc/lispref
diff options
context:
space:
mode:
authorBob Rogers <rogers@rgrjr.com>2023-10-12 10:23:35 -0700
committerEli Zaretskii <eliz@gnu.org>2023-10-14 11:57:30 +0300
commit0ea2d6d9e82d2f88af4545f4b74c48989bf3415d (patch)
tree48fb29865264130a480eecb97cfd255a46a77023 /doc/lispref
parentdc8b336d0254d751ffcb2466a20a650ca9c5f86a (diff)
downloademacs-0ea2d6d9e82d2f88af4545f4b74c48989bf3415d.tar.gz
emacs-0ea2d6d9e82d2f88af4545f4b74c48989bf3415d.tar.bz2
emacs-0ea2d6d9e82d2f88af4545f4b74c48989bf3415d.zip
Document that time-to-days and days-to-time use different epochs
* doc/lispref/os.texi (Time Calculations): * lisp/calendar/time-date.el (days-to-time, time-to-days): Doc fixes. (Bug#66502)
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/os.texi8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 7c8b35236cd..ea27af8edb2 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2104,6 +2104,14 @@ This function returns the number of days between the beginning of year
The operating system limits the range of time and zone values.
@end defun
+@defun days-to-time days
+This is not quite the inverse of the @code{time-to-days} function, as
+it uses the Emacs epoch (instead of the year 1) for historical
+reasons. To get the inverse, subtract @code{(time-to-days 0)} from
+@var{days}, in which case @code{days-to-time} may return @code{nil} if
+@var{days} is negative.
+@end defun
+
@defun time-to-day-in-year time-value
This returns the day number within the year corresponding to @var{time-value},
assuming the default time zone.