There are no base classes.
There are no implemented interfaces.
delimiters
(type:
str
)
'-/.:,+'
flt_pattern
(type: SRE_Pattern
)
<_sre.SRE_Pattern object at 0x40a09a20>
int_pattern
(type: SRE_Pattern
)
<_sre.SRE_Pattern object at 0x41026230>
name_pattern
(type: SRE_Pattern
)
<_sre.SRE_Pattern object at 0x41026288>
space_chars
(type:
str
)
' \t\n'
localZone(ltm=None)
Returns the time zone on the given date. The time zone can change according to daylight savings.
parse(arg, local=True)
Parse a string containing some sort of date-time data.
This function returns a tuple (year, month, day, hour, minute, second, timezone_string).
As a general rule, any date-time representation that is
recognized and unambigous to a resident of North America is
acceptable.(The reason for this qualification is that
in North America, a date like: 2/1/1994 is interpreted
as February 1, 1994, while in some parts of the world,
it is interpreted as January 2, 1994.) A date/time
string consists of two components, a date component and
an optional time component, separated by one or more
spaces. If the time component is omited, 12:00am is
assumed. Any recognized timezone name specified as the
final element of the date/time string will be used for
computing the date/time value. (If you create a DateTime
with the string Mar 9, 1997 1:45pm US/Pacific
, the
value will essentially be the same as if you had captured
time.time() at the specified date and time on a machine in
that timezone)
x=parse(1997/3/9 1:45pm
)
# returns specified time, represented in local machine zone.
y=parse(Mar 9, 1997 13:45:00
)
# y is equal to x
The function automatically detects and handles ISO8601 compliant dates (YYYY-MM-DDThh:ss:mmTZD). See http://www.w3.org/TR/NOTE-datetime for full specs.
The date component consists of year, month, and day values. The year value must be a one-, two-, or four-digit integer. If a one- or two-digit year is used, the year is assumed to be in the twentieth century. The month may an integer, from 1 to 12, a month name, or a month abreviation, where a period may optionally follow the abreviation. The day must be an integer from 1 to the number of days in the month. The year, month, and day values may be separated by periods, hyphens, forward, shashes, or spaces. Extra spaces are permitted around the delimiters. Year, month, and day values may be given in any order as long as it is possible to distinguish the components. If all three components are numbers that are less than 13, then a a month-day-year ordering is assumed.
The time component consists of hour, minute, and second values separated by colons. The hour value must be an integer between 0 and 23 inclusively. The minute value must be an integer between 0 and 59 inclusively. The second value may be an integer value between 0 and 59.999 inclusively. The second value or both the minute and second values may be ommitted. The time may be followed by am or pm in upper or lower case, in which case a 12-hour clock is assumed.
If a string argument passed to the DateTime constructor cannot be parsed, it will raise SyntaxError. Invalid date components will raise a DateError, while invalid time or timezone components will raise a DateTimeError.
time(arg)
Parse a string containing some sort of date-time data.
This function returns the time in seconds since the Epoch (in UTC).
See date() for the description of allowed input values.
There are no known subclasses.