Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clarify utils

commit 3290d0040bba513e9c08124a2460012a0918e310 1 parent 907811e
@brainrape brainrape authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 dateutils/datestring.py
View
15 dateutils/datestring.py
@@ -1,14 +1,15 @@
-from datetime import date, datetime, timedelta
+from datetime import datetime
import pytz
-def date_to_string(string):
- date = string.strftime('%Y-%m-%d @ %H:%M')
- return date
+
+def date_to_string(dt):
+ return dt.strftime('%Y-%m-%d @ %H:%M')
+
def string_to_date(string):
- date = datetime.strptime(string, '%Y-%m-%d @ %H:%M')
- return date
-
+ return datetime.strptime(string, '%Y-%m-%d @ %H:%M')
+
+
def string_to_utc(input_date, input_timezone):
timezone = pytz.timezone(input_timezone)
timestamp = datetime.strptime(input_date, '%Y-%m-%d @ %H:%M')
Please sign in to comment.
Something went wrong with that request. Please try again.