myPIM

Check-in [7f37f2be8b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Get rid of strptime
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:7f37f2be8beffa9d426eb857a32d4d840faa96a5d04a8b7d860ec5cc6a41a265
User & Date: ajv-899-334-8894@vsta.org 2008-11-23 05:36:13
Context
2008-11-23
05:38
Fix usage for new "nm" check-in: 8c5b973784 user: ajv-899-334-8894@vsta.org tags: master, trunk
05:36
Get rid of strptime check-in: 7f37f2be8b user: ajv-899-334-8894@vsta.org tags: master, trunk
05:24
Drop off the somewhat bloated scanf check-in: 36c258b658 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to xcal.py.

320
321
322
323
324
325
326
327
328






329

# Return a Date() for today
def today():
    return Date(*time.localtime()[0:3])

# Parse M/D/Y into a Date
def parse(str):
    # TBD is use a stronger parser than time.strptime()
    tm = time.strptime(str, "%m/%d/%Y")






    return Date(*tm[0:3])







|
|
>
>
>
>
>
>
|
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335

# Return a Date() for today
def today():
    return Date(*time.localtime()[0:3])

# Parse M/D/Y into a Date
def parse(str):
    parts = str.split("/")
    assert len(parts) == 3
    m = int(parts[0])
    assert (m >= 1) and (m <= 12)
    d = int(parts[1])
    assert (d >= 0) and (d <= 31)
    y = int(parts[2])
    assert (y >= 1) and (y <= 100000)
    return Date(y, m, d)