Commit 3f72093a authored by Jérome Perrin's avatar Jérome Perrin

tidrange spec: XXX WIP on timezones

parent bd9badf2
...@@ -52,3 +52,11 @@ go run prototype/proto.go ...@@ -52,3 +52,11 @@ go run prototype/proto.go
``` ```
no more errors reported. no more errors reported.
# TODO
* [ ] spec with "local timezone" properly.
* [ ] make sure go's proto handling of timezone is correct (it's copy pasted from examples)
\ No newline at end of file
...@@ -36,7 +36,9 @@ time.tzset() ...@@ -36,7 +36,9 @@ time.tzset()
if args.relative_time_base and args.relative_time_base != "now": if args.relative_time_base and args.relative_time_base != "now":
dateparser_settings["RELATIVE_BASE"] = datetime.datetime.strptime( dateparser_settings["RELATIVE_BASE"] = datetime.datetime.strptime(
args.relative_time_base, rfc3339_format args.relative_time_base, rfc3339_format
) ).replace(
tzinfo=pytz.utc
) # the Z in our format means UTC
with open(args.formats, "r") as f: with open(args.formats, "r") as f:
for line in f: for line in f:
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
2009-08-30T15:00:00Z 15:00 2009-08-30T15:00:00Z 15:00
2009-08-30T12:00:00Z noon today 2009-08-30T12:00:00Z noon today
2009-08-29T12:00:00Z noon yesterday 2009-08-29T12:00:00Z noon yesterday
2009-01-05T12:00:00Z January 5th noon pm # this input is a bit weird also, what does "noon pm" mean?
# it seems to trigger a bug in python's parser
# 2009-01-05T12:00:00Z January 5th noon pm
# this input is "ambiguous" # this input is "ambiguous"
# 2009-08-29T12:00:00Z 10am noon # 2009-08-29T12:00:00Z 10am noon
...@@ -49,11 +51,13 @@ ...@@ -49,11 +51,13 @@
2009-12-01T00:00:00Z 2009-12-01 2009-12-01T00:00:00Z 2009-12-01
# more # some more cases
#TODO 2018-01-01 10:30:00 UTC # explicit UTC timezone
#TODO 2018-01-02 UTC 2018-01-01T10:30:00Z 2018-01-01 10:30:00 UTC
2018-01-02T00:00:00Z 2018-01-02 UTC
## TODO: these should be in local timezone
#\x03\xc4\x85:\x00\x00\x00\x00 2018-01-01 10:30 #\x03\xc4\x85:\x00\x00\x00\x00 2018-01-01 10:30
#\x03\xc4\x88d\x00\x00\x00\x00 2018-01-02 #\x03\xc4\x88d\x00\x00\x00\x00 2018-01-02
...@@ -62,8 +66,6 @@ ...@@ -62,8 +66,6 @@
2009-08-29T19:20:00Z 1 day ago 2009-08-29T19:20:00Z 1 day ago
2009-07-30T19:20:00Z 1 month ago 2009-07-30T19:20:00Z 1 month ago
### likely not supported: ### not supported:
2018-01-01T10:30:00Z le 1er janvier 2018 à 10h30
2018-01-02T00:00:00Z 2018年1月2日
# \x03\xc4\x85:\x00\x00\x00\x00 le 1er janvier 2018 à 10h30 \ No newline at end of file
# \x03\xc4\x88d\x00\x00\x00\x00 2018年1月2日
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment