Patch to correct Javascript date() result

Dave Higton dave at
Thu Sep 24 22:02:21 BST 2015

This patch removes the 3600 second error in the date/time returned by
the Javascript date() function in RISC OS.

The error is in duktape.c and, as discussed on Monday, I don't think
the code can ever be right - but I've made the deliberate error apply
only to platforms other than RISC OS.

There may be a better solution than this, which I'd like to research,
but this fixes the problem today.


diff --git a/javascript/duktape/duktape.c b/javascript/duktape/duktape.c
index 5ee88ad..9cd1b10 100644
--- a/javascript/duktape/duktape.c
+++ b/javascript/duktape/duktape.c
@@ -27893,7 +27893,9 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_gmtime(duk_double_t d) {
 		goto error;
 	if (tms[1].tm_isdst > 0) {
+#if !defined(riscos)
 		t2 += 3600;
 	} else if (tms[1].tm_isdst < 0) {
 		DUK_D(DUK_DPRINT("tm_isdst is negative: %d", (int) tms[1].tm_isdst));

Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at

More information about the netsurf-dev mailing list