Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodbtools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
zodbtools
Commits
3f72093a
Commit
3f72093a
authored
Jan 10, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidrange spec: XXX WIP on timezones
parent
bd9badf2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
prototype/notes.md
prototype/notes.md
+8
-0
prototype/proto.py
prototype/proto.py
+3
-1
zodbtools/test/testdata/tidrange-formats.txt
zodbtools/test/testdata/tidrange-formats.txt
+11
-9
No files found.
prototype/notes.md
View file @
3f72093a
...
...
@@ -52,3 +52,11 @@ go run prototype/proto.go
```
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
prototype/proto.py
View file @
3f72093a
...
...
@@ -36,7 +36,9 @@ time.tzset()
if
args
.
relative_time_base
and
args
.
relative_time_base
!=
"now"
:
dateparser_settings
[
"RELATIVE_BASE"
]
=
datetime
.
datetime
.
strptime
(
args
.
relative_time_base
,
rfc3339_format
)
).
replace
(
tzinfo
=
pytz
.
utc
)
# the Z in our format means UTC
with
open
(
args
.
formats
,
"r"
)
as
f
:
for
line
in
f
:
...
...
zodbtools/test/testdata/tidrange-formats.txt
View file @
3f72093a
...
...
@@ -26,7 +26,9 @@
2009-08-30T15:00:00Z 15:00
2009-08-30T12:00:00Z noon today
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"
# 2009-08-29T12:00:00Z 10am noon
...
...
@@ -49,11 +51,13 @@
2009-12-01T00:00:00Z 2009-12-01
#
more
#
some more cases
#TODO 2018-01-01 10:30:00 UTC
#TODO 2018-01-02 UTC
# explicit UTC timezone
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\x88d\x00\x00\x00\x00 2018-01-02
...
...
@@ -62,8 +66,6 @@
2009-08-29T19:20:00Z 1 day ago
2009-07-30T19:20:00Z 1 month ago
### likely not supported:
# \x03\xc4\x85:\x00\x00\x00\x00 le 1er janvier 2018 à 10h30
# \x03\xc4\x88d\x00\x00\x00\x00 2018年1月2日
\ No newline at end of file
### not supported:
2018-01-01T10:30:00Z le 1er janvier 2018 à 10h30
2018-01-02T00:00:00Z 2018年1月2日
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment