22 lines
358 B
C
22 lines
358 B
C
|
#include "epoch.h"
|
||
|
#include <assert.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
DateTime dt;
|
||
|
int64_t ts;
|
||
|
|
||
|
int main() {
|
||
|
dt.zone.tag = UTC;
|
||
|
yearNew(&dt.year, 2024);
|
||
|
dt.month = February;
|
||
|
dt.day = 6;
|
||
|
dt.hour = 9;
|
||
|
dt.minute = 28;
|
||
|
dt.second = 42;
|
||
|
dt.nanoseconds = 42;
|
||
|
ts = dateTimeGetTimestamp(&dt);
|
||
|
assert(ts == 1707211722);
|
||
|
|
||
|
return 0;
|
||
|
}
|