Changeset 259


Ignore:
Timestamp:
09/19/07 05:28:30 (7 years ago)
Author:
xi
Message:

Fixed timestamp output (fixes #60).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pysyck/trunk/lib/syck/loaders.py

    r176 r259  
    241241        match = self.timestamp_expr.match(node.value) 
    242242        values = match.groupdict() 
     243        if values['micro']: 
     244            values['micro'] = values['micro'].zfill(6) 
    243245        for key in values: 
    244246            if values[key]: 
     
    246248            else: 
    247249                values[key] = 0 
    248         micro = values['micro'] 
    249         if micro: 
    250             while 10*micro < 1000000: 
    251                 micro *= 10 
    252250        stamp = datetime.datetime(values['year'], values['month'], values['day'], 
    253                 values['hour'], values['minute'], values['second'], micro) 
     251                values['hour'], values['minute'], values['second'], values['micro']) 
    254252        diff = datetime.timedelta(hours=values['zhour'], minutes=values['zminute']) 
    255253        return stamp-diff 
Note: See TracChangeset for help on using the changeset viewer.