HOME


sh-3ll 1.0
DIR:/proc/self/root/usr/share/emacs/26.1/lisp/calendar/
Upload File :
Current File : //proc/self/root/usr/share/emacs/26.1/lisp/calendar/time-date.elc
;ELC
;;; Compiled
;;; in Emacs version 26.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@649 Decode a time value and bind it according to VARLIST, then eval BODY.

The value of the last form in BODY is returned.

Each element of the list VARLIST is a list of the form
(HIGH-SYMBOL LOW-SYMBOL MICRO-SYMBOL [PICO-SYMBOL [TYPE-SYMBOL]] TIME-VALUE).
The time value TIME-VALUE is decoded and the result is bound to
the symbols HIGH-SYMBOL, LOW-SYMBOL and MICRO-SYMBOL.
The optional PICO-SYMBOL is bound to the picoseconds part.

The optional TYPE-SYMBOL is bound to the type of the time value.
Type 0 is the cons cell (HIGH . LOW), type 1 is the list (HIGH
LOW), type 2 is the list (HIGH LOW MICRO), and type 3 is the
list (HIGH LOW MICRO PICO).
(defalias 'with-decoded-time-value '(macro . #[(varlist &rest body) "\203:\211A\242\211\211A\242	\211A\242	\211A\242	G\306X?\205)	\211A\242	G\307=?\2057	\211A\2427	@8\310\311!9\312\3139\3148\315BBD9\316\3179D\320\3219\322BB\3239\324BBED\3259D\312\326\327\330\3319\332BBED\333\334\335\336\3319\337BBDD\340\3369\341BBD\257\342BBD\3439DFD\n\3449DD\f\257
\205\243
C7\205\2537C#\345\3469D\347\350\3449DE\3459\347\350\f\3519DE
\203\363\345\3529D\313\350
\3539DE7\205\3367\354B\"\313\350
\355BB7\205\3567\356B\"F\202\3717\205\371\357E\313\350\f\360BB
\205
\361B7\2057\362B#FE\313\3509\f\363BBBB
\205%
\364B7\205.7\365B#F\366:BBF.\207\347:B\207" [varlist elt high low micro pico 2 1 make-symbol "time" let* append or ((current-time)) cond integerp list ash (-16) logand (65535) floatp usec * 1000000 mod (1) (ps (round (* 1000000 (mod usec 1)))) (us (floor usec)) lo floor (65536) hi (65536) ((if (eq ps 1000000) (progn (setq ps 0) (setq us (1+ us)) (if (eq us 1000000) (progn (setq us 0) (setq lo (1+ lo)) (if (eq lo 65536) (progn (setq lo 0) (setq hi (1+ hi)))))))) (list hi lo us ps)) t pop if consp progn setq car cdr cadr (3) (0) (2) (setq type 2) (0) (0) (1) (0) (0) (0) with-decoded-time-value type time-value gensym body] 18 (#$ . 409)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put with-decoded-time-value lisp-indent-function 1 put edebug-form-spec ((&rest (symbolp symbolp symbolp &or [symbolp symbolp form] [symbolp form] form)) body)] 5)
#@331 Encode HIGH, LOW, MICRO, and PICO into a time value of type TYPE.
Type 0 is the cons cell (HIGH . LOW), type 1 is the list (HIGH LOW),
type 2 is (HIGH LOW MICRO), and type 3 is (HIGH LOW MICRO PICO).

For backward compatibility, if only four arguments are given,
it is assumed that PICO was omitted and should be treated as zero.
(defalias 'encode-time-value #[(high low micro pico &optional type) "\204	\305\306\267\202!\nB\207\nD\207\n\fE\207\n\f	F\207\307\207" [type pico high low micro 0 #s(hash-table size 4 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (0 14 1 18 2 22 3 27)) nil] 4 (#$ . 2600)])
(byte-code "\300\301\302\303#\210\300\304\302\303#\210\305\306\307\"\210\305\310\311\"\207" [make-obsolete encode-time-value nil "25.1" with-decoded-time-value autoload parse-time-string "parse-time" timezone-make-date-arpa-standard "timezone"] 4)
#@126 Parse a string DATE that represents a date-time and return a time value.
If DATE lacks timezone information, GMT is assumed.
(defalias 'date-to-time #[(date) "\3031\f\304\305\306!\"0\207\307	\n\232\203\304\310	\"\202?\3111,\304\305\306\312!!\"0\202?\211\n\232\203:\304\310	\"\202>\313\314\")*\207" [date err overflow-error (error) apply encode-time parse-time-string (error "Specified time is not representable") signal (error) timezone-make-date-arpa-standard error "Invalid date: %s"] 6 (#$ . 3487)])
(defalias 'time-to-seconds 'float-time)
#@34 Convert SECONDS to a time value.
(defalias 'seconds-to-time #[(seconds) "\301\302\"\207" [seconds time-add 0] 3 (#$ . 4050)])
#@33 Convert DAYS into a time value.
(defalias 'days-to-time #[(days) "\3031
\304\305_!0\202\210	\306D\250\203\nA\307\241\210\n)\207" [days most-positive-fixnum time (range-error) seconds-to-time 86400.0 65535 nil] 3 (#$ . 4183)])
#@95 Return the time elapsed since TIME.
TIME should be either a time value or a date-time string.
(defalias 'time-since #[(time) ";\203	\301!\302\303\"\207" [time date-to-time time-subtract nil] 3 (#$ . 4423)])
(byte-code "\300\301\302\303#\210\304\301\302\305#\207" [defalias subtract-time time-subtract nil make-obsolete "26.1"] 4)
#@87 Return the number of days between year 1 and DATE.
DATE should be a date-time string.
(defalias 'date-to-day #[(date) "\301\302!!\207" [date time-to-days date-to-time] 3 (#$ . 4764)])
#@97 Return the number of days between DATE1 and DATE2.
DATE1 and DATE2 should be date-time strings.
(defalias 'days-between #[(date1 date2) "\302!\302	!Z\207" [date1 date2 date-to-day] 3 (#$ . 4955)])
#@34 Return t if YEAR is a leap year.
(defalias 'date-leap-year-p #[(year) "\301\246\302U\203\303\246\302U?\206\304\246\302U\207" [year 4 0 100 400] 2 (#$ . 5159)])
#@78 Return the day number within the year corresponding to the decoded time TIM.
(defalias 'time-date--day-in-year #[(tim) "\3058\3068\3078\n	S\310_\\	\311V\203,\f\312	\305_\\\313\245Z\314!\203,\fT\f,\207" [tim month day year day-of-year 4 3 5 31 2 23 10 date-leap-year-p] 4 (#$ . 5332)])
#@62 Return the day number within the year corresponding to TIME.
(defalias 'time-to-day-in-year #[(time) "\301\302!!\207" [time time-date--day-in-year decode-time] 3 (#$ . 5635)])
#@159 The number of days between the Gregorian date 0001-12-31bce and TIME.
TIME should be a time value.
The Gregorian date Sunday, December 31, 1bce is imaginary.
(defalias 'time-to-days #[(time) "\303!\304	8\305\306	!\nS\307_\nS\310\245\nS\311\245[\nS\312\245%*\207" [time tim year decode-time 5 + time-date--day-in-year 365 4 100 400] 7 (#$ . 5819)])
#@81 Return the number of days represented by TIME.
Returns a floating point number.
(defalias 'time-to-number-of-days #[(time) "\301!\302\245\207" [time float-time 86400] 2 (#$ . 6176)])
#@126 Parse a string DATE that represents a date-time and return a time value.
If DATE is malformed, return a time value of zeros.
(defalias 'safe-date-to-time #[(date) "\3011	\302!0\207\210\303\207" [date (error) date-to-time (0 0)] 2 (#$ . 6367)])
#@867 Use format control STRING to format the number SECONDS.
The valid format specifiers are:
%y is the number of (365-day) years.
%d is the number of days.
%h is the number of hours.
%m is the number of minutes.
%s is the number of seconds.
%z is a non-printing control flag (see below).
%% is a literal "%".

Upper-case specifiers are followed by the unit-name (e.g. "years").
Lower-case specifiers return only the unit.

"%" may be followed by a number specifying a width, with an
optional leading "." for zero-padding.  For example, "%.3Y" will
return something of the form "001 year".

The "%z" specifier does not print anything.  When it is used, specifiers
must be given in order of decreasing size.  To the left of "%z", nothing
is output until the first non-zero unit is encountered.

This function does not work for SECONDS greater than `most-positive-fixnum'.
(defalias 'format-seconds #[(string seconds) "\306\307\310\311\211\211\211\211\211\211\211\211\211!\"#$%&'\312\313('#\203\212\306\225'\314\315(\"\211$\316\230\204!\317$\227&\"\211#\204O\320\321$\"\210\317$\227\"\"\203_\320\322$\"\210#@\323\230\203m\310!\202\200
\204\200\324#8\f\205}\n\fV\n#\"B\"\202!!\203\227
\203\227\320\325!\210&\311)\211*\2034*@\211)@$)A@\324)8\312\326\327$\"(\"\203+$\323\230\203\336\330\331\332(\206\323\306\225\306\224^\311O#(\202+\333+\n\"+	\n_Z+\204\372	\306U?\205\371\306\224\334\326\316\314\315(\"\335Q	\314\324(\"$\230\203\332\202#\326\336	\315U\203!\332\202\"\337##\310\211($(*A\211*\204\242.\330\340\316(#\207" [zeropos num unit name prev larger 0 (("y" "year" 31536000) ("d" "day" 86400) ("h" "hour" 3600) ("m" "minute" 60) ("s" "second" 1) ("z")) t nil string-match "%\\.?[0-9]*\\(.\\)" match-string 1 "%" assoc error "Bad format specifier: `%s'" "Multiple instances of specifier: `%s'" "z" 2 "Units are not in decreasing order of size" format "%%\\(\\.?[0-9]+\\)?\\(%s\\)" replace-regexp-in-string "%z" "" floor replace-match "d%s" " %s%s" "s" "%%" zeroflag usedunits match spec case-fold-search units start string u --dolist-tail-- seconds] 14 (#$ . 6620)])
#@54 Formatting used by the function `seconds-to-string'.
(defvar seconds-to-string (byte-code "\300\301\302E\303\304\300E\305\306\307E\310\311\312E\313\314\315E\316\317\320E\257\207" [1 "ms" 0.001 100 "s" 6000 "m" 60.0 108000 "h" 3600.0 34560000 "d" 86400.0 nil "y" 31557600.0] 8) (#$ . 8777))
#@57 Convert the time interval in seconds to a short string.
(defalias 'seconds-to-string #[(delay) "\304V\203
\305\301[!P\207\304U\203\306\207	\307\211A\242\211@\203+\n@X\204\310\311\nAA@\245\"\nA@P*\207" [delay seconds-to-string here sts 0 "-" "0s" nil format "%.2f"] 4 (#$ . 9074)])
(provide 'time-date)