/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-09 07:09:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1850.
  • Revision ID: john@arbash-meinel.com-20060709070901-f39f56fc35695ed9
Properly handle non-hour timezone offsets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
    'Thu 2005-06-30 12:38:52.350850105 -0500'
125
125
    >>> format_highres_date(1120153132.350850105, 7200)
126
126
    'Thu 2005-06-30 19:38:52.350850105 +0200'
 
127
    >>> format_highres_date(1152428738.867522, 19800)
 
128
    'Sun 2006-07-09 12:35:38.867522001 +0530'
127
129
    """
128
130
    import time
129
131
    assert isinstance(t, float)
155
157
    (1120153132.3508501, 0)
156
158
    >>> unpack_highres_date('Thu 2005-06-30 19:38:52.350850105 +0200')
157
159
    (1120153132.3508501, 7200)
 
160
    >>> unpack_highres_date('Sun 2006-07-09 12:35:38.867522001 +0530')
 
161
    (1152428738.867522, 19800)
158
162
    >>> from bzrlib.osutils import local_time_offset
159
163
    >>> t = time.time()
160
164
    >>> o = local_time_offset()
186
190
    fract_seconds, offset = date[dot_loc:].split()
187
191
    fract_seconds = float(fract_seconds)
188
192
    offset = int(offset)
189
 
    offset = int(offset / 100) * 3600 + offset % 100
 
193
    offset = int(offset / 100) * 3600 + (offset%100) * 60
190
194
    
191
195
    # time.mktime returns localtime, but calendar.timegm returns UTC time
192
196
    timestamp = calendar.timegm(base_time)