~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-23 06:37:30 UTC
  • Revision ID: mbp@sourcefrog.net-20050323063730-3b87f65c4469ab50
fix time.localtime call for python 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
 
180
180
def local_time_offset(t=None):
181
181
    """Return offset of local zone from GMT, either at present or at time t."""
 
182
    # python2.3 localtime() can't take None
 
183
    if t is None:
 
184
        t = time.time()
 
185
        
182
186
    if time.localtime(t).tm_isdst and time.daylight:
183
187
        return -time.altzone
184
188
    else: