- fixed date->time-utc to honor the zone-offset field when converting a date
object to a time-utc object. stats.c, date.ms original commit: 63a97939896c2a89fcffdf16c8b783efaeb816b5
This commit is contained in:
parent
ed1a4da9a1
commit
cfe66a259b
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -12,3 +12,6 @@
|
||||||
/ti3nt/
|
/ti3nt/
|
||||||
/ti3osx/
|
/ti3osx/
|
||||||
Makefile
|
Makefile
|
||||||
|
.*.sw?
|
||||||
|
.sw?
|
||||||
|
bin
|
||||||
|
|
4
LOG
4
LOG
|
@ -55,3 +55,7 @@
|
||||||
- fixed time-utc->date test in mat time&date-printing to work regardless of
|
- fixed time-utc->date test in mat time&date-printing to work regardless of
|
||||||
what locale (and time zone) the host machine has set.
|
what locale (and time zone) the host machine has set.
|
||||||
date.ms
|
date.ms
|
||||||
|
- fixed date->time-utc to honor the zone-offset field when converting a date
|
||||||
|
object to a time-utc object.
|
||||||
|
stats.c,
|
||||||
|
date.ms
|
||||||
|
|
|
@ -375,6 +375,7 @@ ptr S_asctime(ptr dtvec) {
|
||||||
ptr S_mktime(ptr dtvec) {
|
ptr S_mktime(ptr dtvec) {
|
||||||
time_t tx;
|
time_t tx;
|
||||||
struct tm tmx;
|
struct tm tmx;
|
||||||
|
long orig_tzoff = (long)UNFIX(INITVECTIT(dtvec, dtvec_tzoff));
|
||||||
|
|
||||||
tmx.tm_sec = (int)Sinteger_value(Svector_ref(dtvec, dtvec_sec));
|
tmx.tm_sec = (int)Sinteger_value(Svector_ref(dtvec, dtvec_sec));
|
||||||
tmx.tm_min = (int)Sinteger_value(Svector_ref(dtvec, dtvec_min));
|
tmx.tm_min = (int)Sinteger_value(Svector_ref(dtvec, dtvec_min));
|
||||||
|
@ -405,6 +406,7 @@ ptr S_mktime(ptr dtvec) {
|
||||||
INITVECTIT(dtvec, dtvec_year) = Sinteger(tmx.tm_year);
|
INITVECTIT(dtvec, dtvec_year) = Sinteger(tmx.tm_year);
|
||||||
INITVECTIT(dtvec, dtvec_wday) = Sinteger(tmx.tm_wday);
|
INITVECTIT(dtvec, dtvec_wday) = Sinteger(tmx.tm_wday);
|
||||||
INITVECTIT(dtvec, dtvec_yday) = Sinteger(tmx.tm_yday);
|
INITVECTIT(dtvec, dtvec_yday) = Sinteger(tmx.tm_yday);
|
||||||
|
if (tmx.tm_gmtoff != orig_tzoff) tx = difftime(tx, (time_t)(orig_tzoff - tmx.tm_gmtoff));
|
||||||
return Scons(S_integer_time_t(tx), Svector_ref(dtvec, dtvec_nsec));
|
return Scons(S_integer_time_t(tx), Svector_ref(dtvec, dtvec_nsec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -556,6 +556,10 @@
|
||||||
(let ([t (current-time 'time-utc)])
|
(let ([t (current-time 'time-utc)])
|
||||||
(sleep (make-time 'time-duration 0 1))
|
(sleep (make-time 'time-duration 0 1))
|
||||||
(time<? t (date->time-utc (current-date))))
|
(time<? t (date->time-utc (current-date))))
|
||||||
|
(let ([t (current-time)])
|
||||||
|
(time=?
|
||||||
|
(date->time-utc (time-utc->date t -14400))
|
||||||
|
(date->time-utc (time-utc->date t 0))))
|
||||||
)
|
)
|
||||||
|
|
||||||
(mat time&date-printing
|
(mat time&date-printing
|
||||||
|
|
Loading…
Reference in New Issue
Block a user