summaryrefslogtreecommitdiff
path: root/lib/date
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-11-06 23:21:12 -0800
committerOri Bernstein <ori@eigenstate.org>2015-11-06 23:21:12 -0800
commit35a72b699a732f3a331df2595970eb7b532f457d (patch)
treed153acbc0888d731bd7fcd2c4ba28f01a28861fd /lib/date
parent7cee6c2a0554637015c60ccfaac91d783655b20e (diff)
downloadmc-35a72b699a732f3a331df2595970eb7b532f457d.tar.gz
Fix some date formatting functions.
Diffstat (limited to 'lib/date')
-rw-r--r--lib/date/fmt.myr11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/date/fmt.myr b/lib/date/fmt.myr
index 4fc22ee..7ecf5f7 100644
--- a/lib/date/fmt.myr
+++ b/lib/date/fmt.myr
@@ -48,12 +48,12 @@ const datefmt = {sb, fmt, d
| 'A': std.sbfmt(sb, "{}", _names.fullday[d.day])
| 'b': std.sbfmt(sb, "{}", _names.abbrevmon[d.mon])
| 'B': std.sbfmt(sb, "{}", _names.fullmon[d.mon])
- | 'c': datefmt(sb, "%Y-%m-%d", d)
+ | 'c': datefmt(sb, "%Y-%m-%d %H:%M:%S %z", d)
| 'C': std.sbfmt(sb, "{p=0,w=2}", d.year % 100)
| 'd': std.sbfmt(sb, "{p=0,w=2}", d.day)
| 'D': datefmt(sb, "%m/%d/%y (wtf america)", d)
| 'e': std.sbfmt(sb, "{w=2}", d.day)
- | 'F': datefmt(sb, "%y-%m-%d", d)
+ | 'F': datefmt(sb, "%Y-%m-%d", d)
/*
| 'G': s = std.sbfmt(sb, ...?
| 'g':
@@ -70,10 +70,11 @@ const datefmt = {sb, fmt, d
| 'O': std.sbfmt(sb, "unsupported %O")
| 'p': std.sbfmt(sb, "{}", ["AM", "PM"][d.h/12])
| 'P': std.sbfmt(sb, "{}", ["am", "pm"][d.h/12])
- | 'r': datefmt(sb, "%H:%M:%S %P", d)
- | 'R': datefmt(sb, "%H:%M %P", d)
- | 's': std.sbfmt(sb, "{}", d.actual)
+ | 'r': datefmt(sb, "%I:%M:%S %P", d)
+ | 'R': datefmt(sb, "%H:%M", d)
+ | 's': std.sbfmt(sb, "{}", d.actual / 1_000_000)
| 'S': std.sbfmt(sb, "{p=0,w=2}", d.s)
+ | 'T': datefmt(sb, "%H:%M:%S", d)
| 't': std.sbfmt(sb, "\t")
| 'u': std.sbfmt(sb, "{}", d.wday)
| 'U': std.sbfmt(sb, "week number... unimplemented.")