Skip to content

Commit ec6697d

Browse files
authored
Merge pull request #445 from digital-land/fix-NSM-date-issue
Add new datetime conversion
2 parents 17f8233 + a4aa42f commit ec6697d

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

digital_land/datatype/date.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def normalise(self, fieldvalue, issues=None):
2222
for pattern in [
2323
"%Y-%m-%d",
2424
"%Y%m%d",
25+
"%Y%m%d%H%M%S", # added for 14 digit datetime
2526
"%Y/%m/%d %H:%M:%S%z", # added to handle ogr2ogr unix time conversion
2627
"%Y/%m/%d %H:%M:%S+00", # added to handle ogr2ogr unix time conversion
2728
"%Y/%m/%d %H:%M:%S", # added to handle ogr2ogr unix time conversion

tests/unit/datatype/test_date.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class TestDateDataType:
1212
# normal date formats
1313
("2020-01-02", "2020-01-02"),
1414
("20200102", "2020-01-02"),
15+
("20200102000000", "2020-01-02"),
1516
("2020/01/02", "2020-01-02"),
1617
("2020 01 02", "2020-01-02"),
1718
("2020.01.02", "2020-01-02"),

0 commit comments

Comments
 (0)