Skip to content
Snippets Groups Projects
Commit 21672649 authored by Florian Obersteiner's avatar Florian Obersteiner
Browse files

datetime object creation from unpacked int generator

parent 2c56e1a3
No related branches found
No related tags found
1 merge request!6code refactor
......@@ -520,12 +520,8 @@ class Dataset:
# line 7 - UTC date when data begin, UTC date of data reduction or revision
# - comma delimited (yyyy, mm, dd, yyyy, mm, dd).
dmp = f.readline()
self.dateOfCollection = datetime.datetime.strptime(
"".join(["{:s}".format(x) for x in dmp[:3]]), "%Y%m%d"
)
self.dateOfRevision = datetime.datetime.strptime(
"".join(["{:s}".format(x) for x in dmp[3:6]]), "%Y%m%d"
)
self.dateOfCollection = datetime.datetime(*map(int, dmp[:3])) # TODO: set UTC ?!
self.dateOfRevision = datetime.datetime(*map(int, dmp[3:6]))
# line 8 - Data Interval (This value describes the time spacing (in seconds)
# between consecutive data records. It is the (constant) interval between
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment