/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/timestamp.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import time
21
21
import re
22
22
 
23
 
from . import osutils
 
23
from bzrlib import osutils
24
24
 
25
25
 
26
26
def format_highres_date(t, offset=0):
36
36
    this will return a date stamp for right now,
37
37
    formatted for the local timezone.
38
38
 
39
 
    >>> from breezy.osutils import format_date
 
39
    >>> from bzrlib.osutils import format_date
40
40
    >>> format_date(1120153132.350850105, 0)
41
41
    'Thu 2005-06-30 17:38:52 +0000'
42
42
    >>> format_highres_date(1120153132.350850105, 0)
129
129
 
130
130
# Format for patch dates: %Y-%m-%d %H:%M:%S [+-]%H%M
131
131
# Groups: 1 = %Y-%m-%d %H:%M:%S; 2 = [+-]%H; 3 = %M
132
 
RE_PATCHDATE = re.compile("(\\d+-\\d+-\\d+\\s+\\d+:\\d+:\\d+)\\s*([+-]\\d\\d)(\\d\\d)$")
133
 
RE_PATCHDATE_NOOFFSET = re.compile("\\d+-\\d+-\\d+\\s+\\d+:\\d+:\\d+$")
 
132
RE_PATCHDATE = re.compile("(\d+-\d+-\d+\s+\d+:\d+:\d+)\s*([+-]\d\d)(\d\d)$")
 
133
RE_PATCHDATE_NOOFFSET = re.compile("\d+-\d+-\d+\s+\d+:\d+:\d+$")
134
134
 
135
135
def parse_patch_date(date_str):
136
136
    """Parse a patch-style date into a POSIX timestamp and offset.