~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/timestamp.py

  • Committer: Florent Gallaire
  • Date: 2017-03-17 10:39:02 UTC
  • mto: This revision was merged to the branch mainline in revision 6622.
  • Revision ID: fgallaire@gmail.com-20170317103902-xsmafws9vn8rczx9
Fix for Windows and 32-bit platforms buggy gmtime().

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    # revision XML entry will be reproduced faithfully.
58
58
    if offset is None:
59
59
        offset = 0
60
 
    tt = time.gmtime(t + offset)
 
60
    tt = osutils.gmtime(t + offset)
61
61
 
62
62
    return (osutils.weekdays[tt[6]] +
63
63
            time.strftime(" %Y-%m-%d %H:%M:%S", tt)
119
119
    # give the epoch in utc
120
120
    if secs == 0:
121
121
        offset = 0
122
 
    if secs + offset < 0:
123
 
        from warnings import warn
124
 
        warn("gmtime of negative time (%s, %s) may not work on Windows" %
125
 
                (secs, offset))
126
122
    return osutils.format_date(secs, offset=offset,
127
123
            date_fmt='%Y-%m-%d %H:%M:%S')
128
124