Package picalo :: Package base :: Module Calendar
[show private | hide private]
[frames | no frames]

Module picalo.base.Calendar

Classes
Date The Picalo date type to represent dates.
DateFormatInfo A simple class to represent information about a date format
DateTime The Picalo date/time type to represent dates and times.

Function Summary
datetime.timedelta DateDelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks)
A duration in time, such as the difference between two DateTimes.
  DateFormat(datetime_value, format)
Formats a DateTime or Date object for printing using the given format.
  DateTimeFormat(datetime_value, format)
Formats a DateTime or Date object for printing using the given format.
datetime.timedelta TimeDelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks)
A duration in time, such as the difference between two DateTimes.
  _create(klass, subklass, *args, **kargs)
Internal function to create a date or time
  _parse(klass, subklass, stdate, format)
Internal function to initialize a date into a date or datetime object

Variable Summary
list DATE_FORMATS = [['\\d{4}-\\d{1,2}-\\d{1,2}', '%Y-%m-%d']...
SRE_Pattern NATIVE_FORMAT_PARSER = ^(\d{4})-(\d{2})-(\d{2}) +(\d{2})...
list RE_DATETIME_FORMATS = [<picalo.base.Calendar.DateFormatI...

Function Details

DateDelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)

A duration in time, such as the difference between two DateTimes. This is often used in Grouping.stratify_by_date and Grouping.summarize_by_date. Negative numbers specify durations that go backwards in time.
Parameters:
days - The number of days in this duration
           (type=int, long, or float)
seconds - The number of seconds in this duration
           (type=int, long, or float)
microseconds - The number of microseconds in this duration
           (type=int, long, or float)
milliseconds - The number of milliseconds in this duration
           (type=int, long, or float)
minutes - The number of minutes in this duration
           (type=int, long, or float)
hours - The number of hours in this duration
           (type=int, long, or float)
weeks - The number of weeks in this duration
           (type=int, long, or float)
Returns:
A datetime.timedelta object
           (type=datetime.timedelta)

DateFormat(datetime_value, format=None)

Formats a DateTime or Date object for printing using the given format. Search the web for "strftime unix manpage" for the formatting tokens.

DateTimeFormat(datetime_value, format=None)

Formats a DateTime or Date object for printing using the given format. Search the web for "strftime unix manpage" for the formatting tokens.

TimeDelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)

A duration in time, such as the difference between two DateTimes. This is often used in Grouping.stratify_by_date and Grouping.summarize_by_date. Negative numbers specify durations that go backwards in time.
Parameters:
days - The number of days in this duration
           (type=int, long, or float)
seconds - The number of seconds in this duration
           (type=int, long, or float)
microseconds - The number of microseconds in this duration
           (type=int, long, or float)
milliseconds - The number of milliseconds in this duration
           (type=int, long, or float)
minutes - The number of minutes in this duration
           (type=int, long, or float)
hours - The number of hours in this duration
           (type=int, long, or float)
weeks - The number of weeks in this duration
           (type=int, long, or float)
Returns:
A datetime.timedelta object
           (type=datetime.timedelta)

_create(klass, subklass, *args, **kargs)

Internal function to create a date or time

_parse(klass, subklass, stdate, format)

Internal function to initialize a date into a date or datetime object

Variable Details

DATE_FORMATS

Type:
list
Value:
[['\\d{4}-\\d{1,2}-\\d{1,2}', '%Y-%m-%d'],
 ['\\d{2}-\\d{1,2}-\\d{1,2}', '%y-%m-%d'],
 ['\\d{1,2}-\\d{1,2}-\\d{4}', '%m-%d-%Y'],
 ['\\d{4}\\.\\d{1,2}\\.\\d{1,2}', '%Y.%m.%d'],
 ['\\d{2}\\.\\d{1,2}\\.\\d{1,2}', '%y.%m.%d'],
 ['\\d{1,2}\\.\\d{1,2}\\.\\d{4}', '%m.%d.%Y'],
 ['\\d{4} \\d{1,2} \\d{1,2}', '%Y %m %d'],
 ['\\d{2} \\d{1,2} \\d{1,2}', '%y %m %d'],
...                                                                    

NATIVE_FORMAT_PARSER

Type:
SRE_Pattern
Value:
^(\d{4})-(\d{2})-(\d{2}) +(\d{2}):(\d{2}):(\d{2}).(\d{2,7})$           

RE_DATETIME_FORMATS

Type:
list
Value:
[<picalo.base.Calendar.DateFormatInfo instance at 0x5ac120>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac198>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac210>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac260>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac2d8>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac3a0>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac418>,
 <picalo.base.Calendar.DateFormatInfo instance at 0x5ac530>,
...                                                                    

Generated by Epydoc 2.1 on Mon Aug 20 05:38:17 2007 http://epydoc.sf.net