diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-02-13 18:32:42 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-02-13 18:32:42 -0800 |
commit | 489e4213a4223a831e2886c324d56e6019188163 (patch) | |
tree | 13a6338009b510b77272dd9d2b65b6100a231172 /stdlib | |
parent | 8d54fdb9967429c46c8dc84d1c07d994b5c79856 (diff) | |
download | txr-489e4213a4223a831e2886c324d56e6019188163.tar.gz txr-489e4213a4223a831e2886c324d56e6019188163.tar.bz2 txr-489e4213a4223a831e2886c324d56e6019188163.zip |
Support gmtoff and zone in time formatting.
The glibc strftime function can refer to the character
string zone, and numeric zone via %Z and %z. So
let us populate these from the Lisp structure.
* time.c (time_fields_to_tm): Take gmtoff and zone
arguments. Store these values in the struct tm,
suitably converted, instead of zeros and nulls.
In the case of zone, we dynamically allocate a utf-8
string, which will have to be freed.
(time_fields_cleanup): New static function.
Called to clean up any allocations performed by
time_fields_to_tm.
(time_struct_to_tm): Drop the strict parameter.
This is useless because the underlying function
time_fields_to_tm checks for nils and substitutes
zeros. This silliness was introduced in a commit
made in 2016. Extract the gmtoff and zone, passing
these to time_fields_to_tm.
(make_time_impl): Pass nil for gmtoff and zone,
call time_fields_cleanup.
(time_string_meth, time_parse_meth): No need to pass
strict parameter to time_struct_to_tm. Need to call
time_fields_cleanup.
Diffstat (limited to 'stdlib')
0 files changed, 0 insertions, 0 deletions