Skip to main content

Time

main.w
let now = datetime.utcNow();

log(now.toIso());

let then = datetime.fromIso("2020-09-09");
log(then.toIso());

log(then.year);
log(then.month);
log(then.dayOfWeek);
log(then.dayOfMonth);
log(then.hours);
log(then.min);
log(then.sec);
log(then.ms);

log(then.timestamp);
log(then.timestampMs);
log(then.timezone);
Wing console output
# Run locally with wing console
2024-09-09T12:25:01.080Z
2020-09-09T00:00:00.000Z
2020
8
3
9
0
0
0
0
1599609600
1599609600000
0