Mercurial > hg
comparison tests/test-parse-date.t @ 29638:491ee264b9f6 stable
date: accept broader range of ISO 8601 time specs
The "normal" ISO date/time includes a T between date and time. It also
allows dropping the colons and seconds from the timespec. Add new
patterns for these forms as well as tests.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 27 Jul 2016 15:22:36 -0500 |
parents | 79d8e7926a04 |
children | 73b1c328a7da |
comparison
equal
deleted
inserted
replaced
29637:46b2ccce7fde | 29638:491ee264b9f6 |
---|---|
256 $ echo "foo" >> a | 256 $ echo "foo" >> a |
257 $ hg commit -d now -m 'Explicitly committed now.' | 257 $ hg commit -d now -m 'Explicitly committed now.' |
258 $ hg log -d today --template '{desc}\n' | 258 $ hg log -d today --template '{desc}\n' |
259 Explicitly committed now. | 259 Explicitly committed now. |
260 today is a good day to code | 260 today is a good day to code |
261 | |
262 Test parsing various ISO8601 forms | |
263 | |
264 $ hg debugdate "2016-07-27T12:10:21" | |
265 internal: 1469646621 * (glob) | |
266 standard: Wed Jul 27 12:10:21 2016 -0700 | |
267 $ hg debugdate "2016-07-27T12:10:21Z" | |
268 internal: 1469621421 0 | |
269 standard: Wed Jul 27 12:10:21 2016 +0000 | |
270 $ hg debugdate "2016-07-27T12:10:21+00:00" | |
271 internal: 1469621421 0 | |
272 standard: Wed Jul 27 12:10:21 2016 +0000 | |
273 $ hg debugdate "2016-07-27T121021Z" | |
274 internal: 1469621421 0 | |
275 standard: Wed Jul 27 12:10:21 2016 +0000 | |
276 | |
277 $ hg debugdate "2016-07-27 12:10:21" | |
278 internal: 1469646621 * (glob) | |
279 standard: Wed Jul 27 12:10:21 2016 -0700 | |
280 $ hg debugdate "2016-07-27 12:10:21Z" | |
281 internal: 1469621421 0 | |
282 standard: Wed Jul 27 12:10:21 2016 +0000 | |
283 $ hg debugdate "2016-07-27 12:10:21+00:00" | |
284 internal: 1469621421 0 | |
285 standard: Wed Jul 27 12:10:21 2016 +0000 | |
286 $ hg debugdate "2016-07-27 121021Z" | |
287 internal: 1469621421 0 | |
288 standard: Wed Jul 27 12:10:21 2016 +0000 |