TemporalZ

zonedDateTimeISO

Returns the current date and time as a Temporal.ZonedDateTime object, in the ISO 8601 calendar and the specified time zone.

When time_zone_like is null, the system time zone is used.

See: Temporal.Now.zonedDateTimeISO

Parameters

#
allocator:std.mem.Allocator
std.mem.Allocator
io:std.Io
std.Io
time_zone_like:?[]const u8
?[]const u8

Source

Implementation

#
pub fn zonedDateTimeISO(allocator: std.mem.Allocator, io: std.Io, time_zone_like: ?[]const u8) !ZonedDateTime {
    const now = try instant(io);
    defer now.deinit();
    const time_zone = try resolveTimeZone(allocator, io, time_zone_like);
    return ZonedDateTime.fromEpochNanoseconds(now.epochNanoseconds(), time_zone);
}