Skip to content

Commit c0aebbf

Browse files
author
Richard Jones
committed
always default time to 00:00:00
1 parent b048332 commit c0aebbf

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ are given with the most recent entry first.
55
- key the templates cache off full path, not filename
66
- implemented whole-database locking
77
- hyperlinking of special text (url, email, item designator) in messages
8+
- fixed time default in date.py
89

910

1011
2002-12-11 0.5.3

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Gordon McMillan,
7777
Patrick Ohly,
7878
Will Partain,
7979
Bernhard Reiter,
80+
John P. Rouillard,
8081
Dougal Scott,
8182
Stefan Seefeld,
8283
Jeffrey P Shell,

roundup/date.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: date.py,v 1.37 2002-12-09 02:43:21 richard Exp $
18+
# $Id: date.py,v 1.38 2002-12-16 04:39:36 richard Exp $
1919

2020
__doc__ = """
2121
Date, time and time interval handling.
@@ -244,15 +244,18 @@ def set(self, spec, offset=0, date_re=re.compile(r'''
244244

245245
info = m.groupdict()
246246

247-
# get the current date/time using the offset
248-
y,m,d,H,M,S,x,x,x = time.gmtime(time.time())
247+
# get the current date as our default
248+
y,m,d = time.gmtime(time.time())[:3]
249+
250+
# time defaults to 00:00:00 _always_
251+
H = M = S = 0
249252

250253
# override year, month, day parts
251254
if info['m'] is not None and info['d'] is not None:
252255
m = int(info['m'])
253256
d = int(info['d'])
254-
if info['y'] is not None: y = int(info['y'])
255-
H = M = S = 0
257+
if info['y'] is not None:
258+
y = int(info['y'])
256259

257260
# override hour, minute, second parts
258261
if info['H'] is not None and info['M'] is not None:

0 commit comments

Comments
 (0)