toJSON
Returns a string representing this duration in the ISO 8601 format (same as toString). Intended for JSON serialization.
Parameters
- self:Duration
- Duration
- allocator:std.mem.Allocator
- std.mem.Allocator
Source
Implementation
pub fn toJSON(self: Duration, allocator: std.mem.Allocator) ![]u8 {
return self.toString(allocator, .{});
}