File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 11"""
2- >>> format_ts('201412261010 ')
3- 'Fri, Dec 26 2014 10:10:59 '
2+ >>> format_ts('20141226101000 ')
3+ 'Fri, Dec 26 2014 10:10:00 '
44
5- >>> format_ts('201412261010 ', '%s')
6- 1419617459000
5+ >>> format_ts('20141226101000 ', '%s')
6+ 1419588600
77
88>>> is_wb_handler(DebugEchoHandler())
99False
Original file line number Diff line number Diff line change 1- from pywb .utils .timeutils import timestamp_to_datetime
1+ from pywb .utils .timeutils import timestamp_to_datetime , timestamp_to_sec
22from pywb .framework .wbrequestresponse import WbResponse
33from pywb .framework .memento import make_timemap , LINK_FORMAT
44
55import urlparse
66import logging
7- import time
87
98from os import path
109from itertools import imap
@@ -38,10 +37,10 @@ def __call__(self, func):
3837# Filters
3938@template_filter ()
4039def format_ts (value , format_ = '%a, %b %d %Y %H:%M:%S' ):
41- value = timestamp_to_datetime (value )
4240 if format_ == '%s' :
43- return int ( time . mktime ( value . timetuple ()) * 1000 )
41+ return timestamp_to_sec ( value )
4442 else :
43+ value = timestamp_to_datetime (value )
4544 return value .strftime (format_ )
4645
4746
You can’t perform that action at this time.
0 commit comments