Github User Fetcher
1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duktape-1.8.0/examples/dummy-date-provider/dummy_date_provider.c
Go to the documentation of this file.
1
/*
2
* Dummy Date provider
3
*
4
* There are two minimally required macros which you must provide in
5
* duk_config.h:
6
*
7
* extern duk_double_t dummy_get_now(void);
8
*
9
* #define DUK_USE_DATE_GET_NOW(ctx) dummy_get_now()
10
* #define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) 0
11
*
12
* Note that since the providers are macros, you don't need to use
13
* all arguments. Similarly, you can "return" fixed values as
14
* constants. Above, local timezone offset is always zero i.e.
15
* we're always in UTC.
16
*
17
* You can also provide optional macros to parse and format timestamps
18
* in a platform specific format. If not provided, Duktape will use
19
* ISO 8601 only (which is often good enough).
20
*/
21
22
#include "duktape.h"
23
24
duk_double_t
dummy_get_now
(
void
) {
25
/* Return a fixed time here as a dummy example. */
26
return
-11504520000.0;
27
}
duk_double_t
double duk_double_t
Definition
duktape-1.5.2/src-noline/duk_config.h:1877
dummy_get_now
duk_double_t dummy_get_now(void)
Definition
duktape-1.8.0/examples/dummy-date-provider/dummy_date_provider.c:24
vendor
civetweb
third_party
duktape-1.8.0
examples
dummy-date-provider
dummy_date_provider.c
Generated by
1.10.0