Skip to content
Snippets Groups Projects
Commit a38e6836 authored by sveseli's avatar sveseli
Browse files

use local timestamps for comparison

parent 98eca8bf
No related branches found
No related tags found
No related merge requests found
......@@ -10,12 +10,13 @@ import urlparse
class FtpUtility:
def __init__(self, host, port, username=None, password=None):
def __init__(self, host, port, username=None, password=None, utcTimeStamps=True):
self.host = host
self.port = port
self.username = username
self.password = password
self.ftpClient = None
self.utcTimeStamps = utcTimeStamps
self.mlsdFileStatDict = {}
@classmethod
......@@ -111,6 +112,8 @@ class FtpUtility:
fileInfo['fileSize'] = fileStatDict.get('Size')
modifyTime = fileStatDict.get('Modify')
modifyTime = time.mktime(time.strptime(modifyTime, '%Y%m%d%H%M%S'))
if self.utcTimeStamps:
modifyTime = TimeUtility.utcToLocalTime(modifyTime)
fileInfo['fileModificationTime'] = modifyTime
fileInfo['fileModificationTimeStamp'] = TimeUtility.formatLocalTimeStamp(modifyTime)
del self.mlsdFileStatDict[fileName]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment