NWNX:EE
8193.36.12
inc_sqlite_time.nss
Go to the documentation of this file.
1
9
string
SQLite_GetFormattedSystemTime
(
string
format);
10
12
int
SQLite_GetTimeStamp
();
13
15
struct
SQLite_MillisecondTimeStamp
16
{
17
int
seconds
;
18
int
milliseconds
;
19
};
20
23
struct
SQLite_MillisecondTimeStamp
SQLite_GetMillisecondTimeStamp
();
24
27
string
SQLite_GetSystemDate
();
28
31
string
SQLite_GetSystemTime
();
32
34
35
string
SQLite_GetFormattedSystemTime
(
string
format)
36
{
37
sqlquery query = SqlPrepareQueryObject(GetModule(),
"SELECT STRFTIME(@format, 'now', 'localtime')"
);
38
SqlBindString(query,
"@format"
, format);
39
SqlStep(query);
// sqlite returns NULL for invalid format in STRFTIME()
40
return
SqlGetString(query, 0);
41
}
42
43
int
SQLite_GetTimeStamp
()
44
{
45
sqlquery query = SqlPrepareQueryObject(GetModule(),
"SELECT STRFTIME('%s', 'now')"
);
46
SqlStep(query);
47
return
SqlGetInt(query, 0);
48
}
49
50
struct
SQLite_MillisecondTimeStamp
SQLite_GetMillisecondTimeStamp
()
51
{
52
sqlquery query = SqlPrepareQueryObject(GetModule(),
"SELECT STRFTIME('%s', 'now'), SUBSTR(STRFTIME('%f', 'now'), 4)"
);
53
SqlStep(query);
54
struct
SQLite_MillisecondTimeStamp
t;
55
t.
seconds
= SqlGetInt(query, 0);
56
t.
milliseconds
= SqlGetInt(query, 1);
57
return
t;
58
}
59
60
string
SQLite_GetSystemDate
()
61
{
62
return
SQLite_GetFormattedSystemTime
(
"%m/%d/%Y"
);
63
}
64
65
string
SQLite_GetSystemTime
()
66
{
67
return
SQLite_GetFormattedSystemTime
(
"%H:%M:%S"
);
68
}
SQLite_GetSystemTime
string SQLite_GetSystemTime()
Returns current time.
Definition:
inc_sqlite_time.nss:65
SQLite_GetFormattedSystemTime
string SQLite_GetFormattedSystemTime(string format)
Returns the current time formatted according to the provided sqlite date time format string.
Definition:
inc_sqlite_time.nss:35
SQLite_MillisecondTimeStamp::seconds
int seconds
Seconds since epoch.
Definition:
inc_sqlite_time.nss:17
SQLite_MillisecondTimeStamp::milliseconds
int milliseconds
Milliseconds.
Definition:
inc_sqlite_time.nss:18
SQLite_GetTimeStamp
int SQLite_GetTimeStamp()
Definition:
inc_sqlite_time.nss:43
SQLite_MillisecondTimeStamp
A millisecond timestamp.
Definition:
inc_sqlite_time.nss:15
SQLite_GetSystemDate
string SQLite_GetSystemDate()
Returns the current date.
Definition:
inc_sqlite_time.nss:60
SQLite_GetMillisecondTimeStamp
struct SQLite_MillisecondTimeStamp SQLite_GetMillisecondTimeStamp()
Definition:
inc_sqlite_time.nss:50
Compatibility
inc_sqlite_time.nss
Generated on Tue Oct 22 2024 12:19:42 for NWNX:EE by
1.8.17.
Dark version