Commit bf96eac
committed
python: format all zero UtilDatetime objects as an empty string
Problem: It is inconvenient that UtilDatetime objects (obtained via the
`!d` conversion specifier) are treated differently than the normal
datetime conversion (`!D`) when the timestamp is zero. In the first
case, the datetime is rendered to the epoch date in whatever format
is specified by the user, while in the second case the result is an
empty string. Since a zero timestamp is considered "unset", the empty
string is much more preferable here.
Since the prime use case for UtilDatetime is in output format rendering
for utilities, have this class return an empty string by default for
zero timestamps, presuming these are unset.
Fix one test in t2800-jobs-cmd.t that assumed a 00:00 result.1 parent e3c8698 commit bf96eac
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
| 1011 | + | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
| |||
0 commit comments