summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-04 00:08:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-04 00:08:01 -0700
commit93f0e3d10580b0a8126018d0a05dd46b1aa84bf6 (patch)
treef16479c293e657f411cde1346f37df224fe821f2 /txr.1
parentd2aac0db3dbabc163aad4722025db6051f56d804 (diff)
downloadtxr-93f0e3d10580b0a8126018d0a05dd46b1aa84bf6.tar.gz
txr-93f0e3d10580b0a8126018d0a05dd46b1aa84bf6.tar.bz2
txr-93f0e3d10580b0a8126018d0a05dd46b1aa84bf6.zip
New time-parse-local and time-parse-utc functions.
* eval.c (eval_init): Register intrinsic functions time-parse-local and time-parse-utc. * lib.c (strptime_wrap): New static function. (time_parse): Now implemented as by call to strptime_wrap. (time_parse_local, time_parse_utc): New functions. These get the time_t time from struct tm without constructing the intermediate Lisp structure. * lib.h (time_parse_local, time_parse_utc): Declared. * txr.1: Documented new functions.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.126
1 files changed, 23 insertions, 3 deletions
diff --git a/txr.1 b/txr.1
index 4125f9a8..31f3d468 100644
--- a/txr.1
+++ b/txr.1
@@ -43587,9 +43587,11 @@ function or from the
.code time-usec
function.
-.coNP Function @ time-parse
+.coNP Functions @, time-parse @ time-parse-local and @ time-parse-utc
.synb
.mets (time-parse < format << string )
+.mets (time-parse-local < format << string )
+.mets (time-parse-utc < format << string )
.syne
.desc
The
@@ -43620,8 +43622,26 @@ if interpreted in the UTC timezone as by the
.meta time-utc
method.
-Note: the availability of
-.code time-parse
+The
+.code time-parse-local
+and
+.code time-parse-utc
+functions return an integer time value: the same value
+that would be returned by the
+.code time-local
+and
+.code time-utc
+methods, respectively, when applied to the structure
+object returned by
+.codn time-parse .
+Thus, these equivalences hold:
+
+.cblk
+ (time-parse-local f s) <--> (time-parse f s).(time-local)
+ (time-parse-utc f s) <--> (time-parse f s).(time-utc)
+.cble
+
+Note: the availability of these three functions
depends on the availability of
.codn strptime .