Changeset 2538

Show
Ignore:
Timestamp:
10/06/05 15:55:14 (19 years ago)
Author:
jerome
Message:

Fixed a localtime issue with LDAP

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2464 r2538  
    587587                if lastjob.JobTitle == lastjob.JobFileName == lastjob.JobOptions == "hidden" : 
    588588                    (lastjob.JobTitle, lastjob.JobFileName, lastjob.JobOptions) = (_("Hidden because of privacy concerns"),) * 3 
    589                 date = fields.get("createTimestamp", ["19700101000000"])[0] 
    590                 year = int(date[:4]) 
    591                 month = int(date[4:6]) 
    592                 day = int(date[6:8]) 
    593                 hour = int(date[8:10]) 
    594                 minute = int(date[10:12]) 
    595                 second = int(date[12:14]) 
    596                 lastjob.JobDate = "%04i-%02i-%02i %02i:%02i:%02i" % (year, month, day, hour, minute, second) 
     589                date = fields.get("createTimestamp", ["19700101000000Z"])[0] # It's in UTC ! 
     590                mxtime = DateTime.strptime(date[:14], "%Y%m%d%H%M%S").localtime() 
     591                lastjob.JobDate = mxtime.strftime("%Y%m%d %H:%M:%S") 
    597592                lastjob.Exists = 1 
    598593        return lastjob 
     
    11861181                if job.JobTitle == job.JobFileName == job.JobOptions == "hidden" : 
    11871182                    (job.JobTitle, job.JobFileName, job.JobOptions) = (_("Hidden because of privacy concerns"),) * 3 
    1188                 date = fields.get("createTimestamp", ["19700101000000"])[0] 
    1189                 year = int(date[:4]) 
    1190                 month = int(date[4:6]) 
    1191                 day = int(date[6:8]) 
    1192                 hour = int(date[8:10]) 
    1193                 minute = int(date[10:12]) 
    1194                 second = int(date[12:14]) 
    1195                 job.JobDate = "%04i%02i%02i %02i:%02i:%02i" % (year, month, day, hour, minute, second) 
     1183                date = fields.get("createTimestamp", ["19700101000000Z"])[0] # It's in UTC ! 
     1184                mxtime = DateTime.strptime(date[:14], "%Y%m%d%H%M%S").localtime() 
     1185                job.JobDate = mxtime.strftime("%Y%m%d %H:%M:%S") 
    11961186                if ((start is None) and (end is None)) or \ 
    11971187                   ((start is None) and (job.JobDate <= end)) or \