git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cosmetic, rename variable expected to be a datetime as 'dt' as opposed to 'input...
[sfa.git]
/
sfa
/
util
/
sfatime.py
diff --git
a/sfa/util/sfatime.py
b/sfa/util/sfatime.py
index
07067ca
..
75a2e4a
100644
(file)
--- a/
sfa/util/sfatime.py
+++ b/
sfa/util/sfatime.py
@@
-78,16
+78,16
@@
For safety this can also handle inputs that are either timestamps, or datetimes
else:
logger.error("Unexpected type in utcparse [%s]"%type(input))
else:
logger.error("Unexpected type in utcparse [%s]"%type(input))
-def datetime_to_string(
inpu
t):
- return datetime.datetime.strftime(
inpu
t, SFATIME_FORMAT)
+def datetime_to_string(
d
t):
+ return datetime.datetime.strftime(
d
t, SFATIME_FORMAT)
-def datetime_to_utc(
inpu
t):
- return time.gmtime(datetime_to_epoch(
inpu
t))
+def datetime_to_utc(
d
t):
+ return time.gmtime(datetime_to_epoch(
d
t))
# see https://docs.python.org/2/library/time.html
# all timestamps are in UTC so time.mktime() would be *wrong*
# see https://docs.python.org/2/library/time.html
# all timestamps are in UTC so time.mktime() would be *wrong*
-def datetime_to_epoch(
inpu
t):
- return int(calendar.timegm(
inpu
t.timetuple()))
+def datetime_to_epoch(
d
t):
+ return int(calendar.timegm(
d
t.timetuple()))
def add_datetime(input, days=0, hours=0, minutes=0, seconds=0):
"""
def add_datetime(input, days=0, hours=0, minutes=0, seconds=0):
"""