File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
- >>> format_ts('201412261010 ')
3
- 'Fri, Dec 26 2014 10:10:59 '
2
+ >>> format_ts('20141226101000 ')
3
+ 'Fri, Dec 26 2014 10:10:00 '
4
4
5
- >>> format_ts('201412261010 ', '%s')
6
- 1419617459000
5
+ >>> format_ts('20141226101000 ', '%s')
6
+ 1419588600
7
7
8
8
>>> is_wb_handler(DebugEchoHandler())
9
9
False
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
2
2
from pywb .framework .wbrequestresponse import WbResponse
3
3
from pywb .framework .memento import make_timemap , LINK_FORMAT
4
4
5
5
import urlparse
6
6
import logging
7
- import time
8
7
9
8
from os import path
10
9
from itertools import imap
@@ -38,10 +37,10 @@ def __call__(self, func):
38
37
# Filters
39
38
@template_filter ()
40
39
def format_ts (value , format_ = '%a, %b %d %Y %H:%M:%S' ):
41
- value = timestamp_to_datetime (value )
42
40
if format_ == '%s' :
43
- return int ( time . mktime ( value . timetuple ()) * 1000 )
41
+ return timestamp_to_sec ( value )
44
42
else :
43
+ value = timestamp_to_datetime (value )
45
44
return value .strftime (format_ )
46
45
47
46
You can’t perform that action at this time.
0 commit comments