aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gildea2026-03-30 08:40:56 -0700
committerStephen Gildea2026-03-30 08:44:38 -0700
commitd88bcc5e2e396ecbc13d207c58bc5c68acf7bb53 (patch)
treebc5456b669d2a98f153506eeb6af6b7050ce9c44
parent9c75d761a570c0dff63886987448be507a658430 (diff)
downloademacs-d88bcc5e2e396ecbc13d207c58bc5c68acf7bb53.tar.gz
emacs-d88bcc5e2e396ecbc13d207c58bc5c68acf7bb53.zip
; time-stamp: doc strings updates
* lisp/time-stamp.el (time-stamp-format): Spelling fix. (time-stamp-formatz-from-parsed-options): Document as internal.
-rw-r--r--lisp/time-stamp.el60
1 files changed, 33 insertions, 27 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index b7f72f2619c..671cf5a1547 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -53,7 +53,7 @@ with %, which are converted as follows:
53%H 24-hour clock hour %I 12-hour clock hour 53%H 24-hour clock hour %I 12-hour clock hour
54%m month number 54%m month number
55%M minute 55%M minute
56%p meridian indicator: `AM', `PM' 56%p meridiem indicator: `AM', `PM'
57%S seconds 57%S seconds
58%w day number of week, Sunday is 0 58%w day number of week, Sunday is 0
59%Y 4-digit year %y 2-digit year 59%Y 4-digit year %y 2-digit year
@@ -1039,39 +1039,45 @@ This is an internal function called by `time-stamp'."
1039 offset-secs) 1039 offset-secs)
1040 "Format a time offset according to a %z variation. 1040 "Format a time offset according to a %z variation.
1041 1041
1042With no flags, the output includes hours and minutes: +-HHMM 1042Format parts FLAG-MINIMIZE, FLAG-PAD-SPACES-ONLY,
1043unless there is a non-zero seconds part, in which case the seconds 1043FLAG-PAD-ZEROS-FIRST, COLON-COUNT, and FIELD-WIDTH
1044are included: +-HHMMSS 1044are used to format time zone offset OFFSET-SECS.
1045
1046FLAG-MINIMIZE is whether \"-\" was specified. If non-nil, the
1047output may be limited to hours if minutes and seconds are zero.
1048
1049FLAG-PAD-SPACES-ONLY is whether \"_\" was specified. If non-nil,
1050seconds must be output, so that any padding can be spaces only.
1051
1052FLAG-PAD-ZEROS-FIRST is whether \"0\" was specified. If non-nil,
1053padding to the requested FIELD-WIDTH (if any) is done by adding
105400 seconds before padding with spaces.
1055
1056COLON-COUNT is the number of colons preceding the \"z\" (0-3). One or
1057two colons put that many colons in the output (+-HH:MM or +-HH:MM:SS).
1058Three colons outputs only hours if minutes and seconds are zero and
1059includes colon separators if minutes and seconds are output.
1060
1061FIELD-WIDTH is a whole number giving the minimum number of characters
1062in the output; 0 specifies no minimum. Additional characters will be
1063added on the right if necessary. The added characters will be spaces
1064unless FLAG-PAD-ZEROS-FIRST is non-nil.
1065
1066OFFSET-SECS is the time zone offset (in seconds east of UTC) to be
1067formatted according to the preceding parameters.
1068 1045
1069This is an internal function used by `time-stamp'." 1046This is an internal function used by `time-stamp'."
1047
1070 ;; Callers of this function need to have already parsed the %z 1048 ;; Callers of this function need to have already parsed the %z
1071 ;; format string; this function accepts just the parts of the format. 1049 ;; format string; this function accepts just the parts of the format.
1072 ;; `time-stamp-string-preprocess' is the full-fledged parser normally 1050 ;; `time-stamp-string-preprocess' is the full-fledged parser normally
1073 ;; used. The unit test (in time-stamp-tests.el) defines the simpler 1051 ;; used. The unit test (in time-stamp-tests.el) defines the simpler
1074 ;; parser `format-time-offset'. 1052 ;; parser `format-time-offset'.
1053
1054 ;; OFFSET-SECS is the time zone offset (in seconds east of UTC) to be
1055 ;; formatted according to the following parameters.
1056
1057 ;; FLAG-MINIMIZE is whether \"-\" was specified. If non-nil, the
1058 ;; output may be limited to hours if minutes and seconds are zero.
1059
1060 ;; FLAG-PAD-SPACES-ONLY is whether \"_\" was specified. If non-nil,
1061 ;; seconds must be output, so that any padding can be spaces only.
1062
1063 ;; FLAG-PAD-ZEROS-FIRST is whether \"0\" was specified. If non-nil,
1064 ;; padding to the requested FIELD-WIDTH (if any) is done by adding
1065 ;; 00 seconds before padding with spaces.
1066
1067 ;; COLON-COUNT is the number of colons preceding the \"z\" (0-3). One or
1068 ;; two colons put that many colons in the output (+-HH:MM or +-HH:MM:SS).
1069 ;; Three colons outputs only hours if minutes and seconds are zero and
1070 ;; includes colon separators if minutes and seconds are output.
1071
1072 ;; FIELD-WIDTH is a whole number giving the minimum number of characters
1073 ;; in the output; 0 specifies no minimum. Additional characters will be
1074 ;; added on the right if necessary. The added characters will be spaces
1075 ;; unless FLAG-PAD-ZEROS-FIRST is non-nil.
1076
1077 ;; With no flags set, the output includes hours and minutes: +-HHMM
1078 ;; unless there is a non-zero seconds part, in which case the seconds
1079 ;; are included: +-HHMMSS
1080
1075 (let ((hrs (/ (abs offset-secs) 3600)) 1081 (let ((hrs (/ (abs offset-secs) 3600))
1076 (mins (/ (% (abs offset-secs) 3600) 60)) 1082 (mins (/ (% (abs offset-secs) 3600) 60))
1077 (secs (% (abs offset-secs) 60)) 1083 (secs (% (abs offset-secs) 60))