summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-08-22 21:08:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-08-22 21:08:14 -0700
commitabd55f06d231eaa918a3ee99a17101005f751e84 (patch)
tree77b4022afa0c2c8eaf37504e46221a4b6c957cf4 /txr.1
parent2ac1a60fa62041345bc461edb3e7d0d74a0055cd (diff)
downloadtxr-abd55f06d231eaa918a3ee99a17101005f751e84.tar.gz
txr-abd55f06d231eaa918a3ee99a17101005f751e84.tar.bz2
txr-abd55f06d231eaa918a3ee99a17101005f751e84.zip
New time-string method on time struct.
* lib.c (time_string_s): New symbol variable. (time_fields_to_tm, time_struct_to_tm): New static functions. (make_time_impl): Replace bunch of code with call to time_fields_to_tm. (time_string_meth): New static function. (time_init): Initialize time_string_s. Add time-string static slot to time struct. Register time-string method. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.122
1 files changed, 22 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 44141f12..ee4c986c 100644
--- a/txr.1
+++ b/txr.1
@@ -36579,6 +36579,28 @@ which are applied to
or
.codn make-time-utc .
+.coNP Method @ time-string
+.synb
+.mets << time-struct .(time-string << format )
+.syne
+.desc
+The
+.code time
+structure has a method called
+.codn time-string .
+
+This method accepts a
+.meta format
+string argument, which it uses to convert
+the fields to a character string representation
+which is returned.
+
+The
+.meta format
+argument is a string, and follows exactly the same conventions as
+the format string of the C library function
+.codn strftime .
+
.coNP Functions @ make-time and @ make-time-utc
.synb
.mets (make-time < year < month < day < hour < minute < second << dst-advice )