| author | |
| committer | |
| log | d9600adbebfca90a8e795f1c072e9e681fa86d81 |
| tree | 38639a59545fa6c396190b9ec7c56733a721b84d |
| parent | 04a75bd1e387fac71c302cf19147b42e78c6e197 |
2 files changed, 31 insertions(+), 10 deletions(-)
main.zig+20| ... | @@ -125,6 +125,26 @@ comptime { | ... | @@ -125,6 +125,26 @@ comptime { |
| 125 | 125 | ||
| 126 | .{ "x", "1144509852789" }, | 126 | .{ "x", "1144509852789" }, |
| 127 | .{ "X", "1144509852" }, | 127 | .{ "X", "1144509852" }, |
| 128 | |||
| 129 | .{ time.format.LT, "3:24 PM" }, | ||
| 130 | |||
| 131 | .{ time.format.LTS, "3:24:12 PM" }, | ||
| 132 | |||
| 133 | .{ time.format.L, "04/08/2006" }, | ||
| 134 | |||
| 135 | .{ time.format.l, "4/8/2006" }, | ||
| 136 | |||
| 137 | .{ time.format.LL, "April 8, 2006" }, | ||
| 138 | |||
| 139 | .{ time.format.ll, "Apr 8, 2006" }, | ||
| 140 | |||
| 141 | .{ time.format.LLL, "April 8, 2006 3:24 PM" }, | ||
| 142 | |||
| 143 | .{ time.format.lll, "Apr 8, 2006 3:24 PM" }, | ||
| 144 | |||
| 145 | .{ time.format.LLLL, "Saturday, April 8, 2006 3:24 PM" }, | ||
| 146 | |||
| 147 | .{ time.format.llll, "Sat, Apr 8, 2006 3:24 PM" }, | ||
| 128 | }); | 148 | }); |
| 129 | 149 | ||
| 130 | // https://github.com/nektro/zig-time/issues/3 | 150 | // https://github.com/nektro/zig-time/issues/3 |
time.zig+11-10| ... | @@ -311,6 +311,7 @@ pub const DateTime = struct { | ... | @@ -311,6 +311,7 @@ pub const DateTime = struct { |
| 311 | '.', | 311 | '.', |
| 312 | 'T', | 312 | 'T', |
| 313 | 'W', | 313 | 'W', |
| 314 | '/', | ||
| 314 | => { | 315 | => { |
| 315 | try writer.writeAll(&.{c}); | 316 | try writer.writeAll(&.{c}); |
| 316 | s = i + 1; | 317 | s = i + 1; |
| ... | @@ -403,16 +404,16 @@ pub const DateTime = struct { | ... | @@ -403,16 +404,16 @@ pub const DateTime = struct { |
| 403 | }; | 404 | }; |
| 404 | 405 | ||
| 405 | pub const format = struct { | 406 | pub const format = struct { |
| 406 | pub const LT = ""; | 407 | pub const LT = "h:mm A"; |
| 407 | pub const LTS = ""; | 408 | pub const LTS = "h:mm:ss A"; |
| 408 | pub const L = ""; | 409 | pub const L = "MM/DD/YYYY"; |
| 409 | pub const l = ""; | 410 | pub const l = "M/D/YYY"; |
| 410 | pub const LL = ""; | 411 | pub const LL = "MMMM D, YYYY"; |
| 411 | pub const ll = ""; | 412 | pub const ll = "MMM D, YYY"; |
| 412 | pub const LLL = ""; | 413 | pub const LLL = LL ++ " " ++ LT; |
| 413 | pub const lll = ""; | 414 | pub const lll = ll ++ " " ++ LT; |
| 414 | pub const LLLL = ""; | 415 | pub const LLLL = "dddd, " ++ LLL; |
| 415 | pub const llll = ""; | 416 | pub const llll = "ddd, " ++ lll; |
| 416 | }; | 417 | }; |
| 417 | 418 | ||
| 418 | pub const TimeZone = enum { | 419 | pub const TimeZone = enum { |