diff options
Diffstat (limited to '')
-rwxr-xr-x | pyblog | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -98,13 +98,6 @@ WHITE = "" YELLOW = "" RESET = "" -def current_datetime(): - """Return the current datetime, complete with tzinfo. - - Precision is one second. Timezone is the local timezone. - """ - return datetime.datetime.fromtimestamp(round(time.time()), - dateutil.tz.tzlocal()) def generate_menu(): """Generate menu.""" @@ -804,7 +797,7 @@ def generate_index_and_feed(): generate_notes_list() rewrite_title() - feed.updated_datetime = current_datetime() + feed.updated_datetime = utils.current_datetime() feed.updated = ET.Element("updated") feed.updated.text = feed.updated_datetime.isoformat() @@ -1125,7 +1118,7 @@ def new_post(title): On success. """ - date = current_datetime() + date = utils.current_datetime() filename_date = date.strftime("%Y-%m-%d") iso_date = date.isoformat() display_date = "%s %d, %d" % (date.strftime("%B"), date.day, date.year) @@ -1177,7 +1170,7 @@ def touch(filename): # update timestamp in the metadata section of the post whatchanged = io.StringIO() - date = current_datetime() + date = utils.current_datetime() iso_date = date.isoformat() display_date = "%s %d, %d" % (date.strftime("%B"), date.day, date.year) filename_date = date.strftime("%Y-%m-%d") |