File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2025 Moddable Tech, Inc.
2+ * Copyright (c) 2025-2026 Moddable Tech, Inc.
33 *
44 * This file is part of the Moddable SDK Runtime.
55 *
@@ -28,29 +28,28 @@ void xs_time_set(xsMachine *the)
2828{
2929 struct timespec ts = { .tv_sec = xsmcToInteger (xsArg (0 )) };
3030 sys_clock_settime (SYS_CLOCK_REALTIME , & ts );
31-
32- ts .tv_sec = 0 ;
33- sys_clock_gettime (SYS_CLOCK_REALTIME , & ts );
3431}
3532
3633void xs_time_timezone_get (xsMachine * the )
3734{
38- xsUnknownError ( "unimplemented" );
35+ xsmcSetInteger ( xsResult , modGetTimeZone () );
3936}
4037
4138void xs_time_timezone_set (xsMachine * the )
4239{
43- xsUnknownError ("unimplemented" );
40+ int32_t seconds = xsmcToInteger (xsArg (0 ));
41+ modSetTimeZone (seconds );
4442}
4543
4644void xs_time_dst_get (xsMachine * the )
4745{
48- xsUnknownError ("unimplemented" );
46+ int32_t seconds = xsmcToInteger (xsArg (0 ));
47+ modSetDaylightSavingsOffset (seconds );
4948}
5049
5150void xs_time_dst_set (xsMachine * the )
5251{
53- xsUnknownError ( "unimplemented" );
52+ xsmcSetInteger ( xsResult , modMilliseconds () );
5453}
5554
5655void xs_time_ticks (xsMachine * the )
You can’t perform that action at this time.
0 commit comments