comparison roundup/date.py @ 3611:86d568dbab55

allow single digit seconds in date spec [SF#1447141]
author Richard Jones <richard@users.sourceforge.net>
date Thu, 27 Apr 2006 05:11:28 +0000
parents f47bddab5a49
children afda59d5d546
comparison
equal deleted inserted replaced
3610:1dbaa664be28 3611:86d568dbab55
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: date.py,v 1.84 2006-03-03 02:02:50 richard Exp $ 18 # $Id: date.py,v 1.85 2006-04-27 05:11:28 richard Exp $
19 19
20 """Date, time and time interval handling. 20 """Date, time and time interval handling.
21 """ 21 """
22 __docformat__ = 'restructuredtext' 22 __docformat__ = 'restructuredtext'
23 23
43 # in a match() 43 # in a match()
44 date_re = re.compile(r'''^ 44 date_re = re.compile(r'''^
45 ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] 45 ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]]
46 |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd 46 |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd
47 (?P<n>\.)? # . 47 (?P<n>\.)? # .
48 (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss 48 (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d?(\.\d+)?))?)? # hh:mm:ss
49 (?P<o>[\d\smywd\-+]+)? # offset 49 (?P<o>[\d\smywd\-+]+)? # offset
50 $''', re.VERBOSE) 50 $''', re.VERBOSE)
51 serialised_date_re = re.compile(r''' 51 serialised_date_re = re.compile(r'''
52 (\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d?(\.\d+)?) 52 (\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d?(\.\d+)?)
53 ''', re.VERBOSE) 53 ''', re.VERBOSE)

Roundup Issue Tracker: http://roundup-tracker.org/