We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8cdabc commit c463772Copy full SHA for c463772
src/libextra/time.rs
@@ -855,7 +855,7 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
855
parse_type('S', tm))
856
}
857
't' => ~"\t",
858
- //'U' {}
+ 'U' => format!("{:02d}", (tm.tm_yday - tm.tm_wday + 7) / 7),
859
'u' => {
860
let i = tm.tm_wday as int;
861
(if i == 0 { 7 } else { i }).to_str()
@@ -1240,7 +1240,7 @@ mod tests {
1240
assert_eq!(local.strftime("%s"), ~"1234567890");
1241
assert_eq!(local.strftime("%T"), ~"15:31:30");
1242
assert_eq!(local.strftime("%t"), ~"\t");
1243
- // assert!(local.strftime("%U") == "06");
+ assert_eq!(local.strftime("%U"), ~"06");
1244
assert_eq!(local.strftime("%u"), ~"5");
1245
// assert!(local.strftime("%V") == "07");
1246
assert_eq!(local.strftime("%v"), ~"13-Feb-2009");
0 commit comments