Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0f8e5431
Commit
0f8e5431
authored
Dec 31, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- use classdesc where we can (for better indexing)
- more style consistency crud
parent
18565411
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
35 deletions
+42
-35
Doc/lib/libdatetime.tex
Doc/lib/libdatetime.tex
+42
-35
No files found.
Doc/lib/libdatetime.tex
View file @
0f8e5431
...
...
@@ -136,8 +136,8 @@ object
A
\class
{
timedelta
}
object represents a duration, the difference
between two dates or times.
\begin{
func
desc}
{
timedelta
}{
days=0, seconds=0, microseconds=0,
milliseconds=0, minutes=0, hours=0, weeks=0
}
\begin{
class
desc}
{
timedelta
}{
days=0, seconds=0, microseconds=0,
milliseconds=0, minutes=0, hours=0, weeks=0
}
All arguments are optional. Arguments may be ints, longs, or floats,
and may be positive or negative.
...
...
@@ -178,19 +178,25 @@ A week is converted to 7 days.
>>> (d.days, d.seconds, d.microseconds)
(-1, 86399, 999999)
\end{verbatim}
\end{
func
desc}
\end{
class
desc}
Class attributes are:
\begin{tableii}
{
c|l
}{
code
}{
Attribute
}{
Value
}
\lineii
{
min
}{
The most negative
\class
{
timedelta
}
object,
\code
{
timedelta(-999999999)
}}
\lineii
{
max
}{
The most positive
\class
{
timedelta
}
object,
timedelta(days=999999999, hours=23, minutes=59, seconds=59,
microseconds=999999)
}
\lineii
{
resolution
}{
The smallest possible difference between non-equal
\class
{
timedelta
}
objects,
\code
{
timedelta(microseconds=1)
}}
\end{tableii}
\begin{memberdesc}
{
min
}
The most negative
\class
{
timedelta
}
object,
\code
{
timedelta(-999999999)
}
.
\end{memberdesc}
\begin{memberdesc}
{
max
}
The most positive
\class
{
timedelta
}
object,
\code
{
timedelta(days=999999999, hours=23, minutes=59, seconds=59,
microseconds=999999)
}
.
\end{memberdesc}
\begin{memberdesc}
{
resolution
}
The smallest possible difference between non-equal
\class
{
timedelta
}
objects,
\code
{
timedelta(microseconds=1)
}
.
\end{memberdesc}
Note that, because of normalization,
\code
{
timedelta.max
}
\textgreater
\code
{
-timedelta.min
}
.
\code
{
-timedelta.max
}
is not representable as
...
...
@@ -277,7 +283,7 @@ directions. January 1 of year 1 is called day number 1, January 2 of year
computations. See the book for algorithms for converting between
proleptic Gregorian ordinals and many other calendar systems.
\begin{
func
desc}
{
date
}{
year, month, day
}
\begin{
class
desc}
{
date
}{
year, month, day
}
All arguments are required. Arguments may be ints or longs, in the
following ranges:
...
...
@@ -289,7 +295,7 @@ proleptic Gregorian ordinals and many other calendar systems.
If an argument outside those ranges is given,
\exception
{
ValueError
}
is raised.
\end{
func
desc}
\end{
class
desc}
Other constructors, all class methods:
...
...
@@ -487,8 +493,8 @@ calendar extended in both directions; like a time object,
\class
{
datetime
}
assumes there are exactly 3600*24 seconds in every
day.
\begin{
func
desc}
{
datetime
}{
year, month, day,
hour=0, minute=0, second=0, microsecond=0
}
\begin{
class
desc}
{
datetime
}{
year, month, day,
hour=0, minute=0, second=0, microsecond=0
}
The year, month and day arguments are required. Arguments may be
ints or longs, in the following ranges:
...
...
@@ -504,7 +510,7 @@ day.
If an argument outside those ranges is given,
\exception
{
ValueError
}
is raised.
\end{
func
desc}
\end{
class
desc}
Other constructors, all class methods:
...
...
@@ -752,9 +758,9 @@ Instance methods:
A
\class
{
time
}
object represents an idealized time of day, independent
of day and timezone.
\begin{
func
desc}
{
time
}{
hour=0, minute=0, second=0, microsecond=0
}
All arguments are optional. They may be ints or longs, in the
following ranges:
\begin{
class
desc}
{
time
}{
hour=0, minute=0, second=0, microsecond=0
}
All arguments are optional. They may be ints or longs, in the
following ranges:
\begin{itemize}
\item
\code
{
0 <=
\var
{
hour
}
< 24
}
...
...
@@ -763,9 +769,9 @@ following ranges:
\item
\code
{
0 <=
\var
{
microsecond
}
< 1000000
}
\end{itemize}
If an argument outside those ranges is given,
\exception
{
ValueError
}
is
raised.
\end{
func
desc}
If an argument outside those ranges is given,
\exception
{
ValueError
}
is
raised.
\end{
class
desc}
Class attributes:
...
...
@@ -948,21 +954,22 @@ particular day, and subject to adjustment via a \class{tzinfo} object.
Constructor:
\begin{funcdesc}
{
time
}{
hour=0, minute=0, second=0, microsecond=0, tzinfo=None
}
\begin{classdesc}
{
time
}{
hour=0, minute=0, second=0, microsecond=0,
tzinfo=None
}
All arguments are optional.
\var
{
tzinfo
}
may be
\code
{
None
}
, or
an instance of a
\class
{
tzinfo
}
subclass. The remaining arguments
may be ints or longs, in the following ranges:
\begin{itemize}
\item
\code
{
0 <=
\var
{
hour
}
< 24
}
\item
\code
{
0 <=
\var
{
minute
}
< 60
}
\item
\code
{
0 <=
\var
{
second
}
< 60
}
\item
\code
{
0 <=
\var
{
microsecond
}
< 1000000
}
.
\end{itemize}
\begin{itemize}
\item
\code
{
0 <=
\var
{
hour
}
< 24
}
\item
\code
{
0 <=
\var
{
minute
}
< 60
}
\item
\code
{
0 <=
\var
{
second
}
< 60
}
\item
\code
{
0 <=
\var
{
microsecond
}
< 1000000
}
.
\end{itemize}
If an argument outside those ranges is given,
\exception
{
ValueError
}
is raised.
\end{
func
desc}
\end{
class
desc}
Class attributes:
...
...
@@ -1092,9 +1099,9 @@ from a \class{date} object and a \class{timetz} object.
Constructor:
\begin{
func
desc}
{
datetimetz
}{
year, month, day,
hour=0, minute=0, second=0, microsecond=0,
tzinfo=None
}
\begin{
class
desc}
{
datetimetz
}{
year, month, day,
hour=0, minute=0, second=0, microsecond=0,
tzinfo=None
}
The year, month and day arguments are required.
\var
{
tzinfo
}
may
be
\code
{
None
}
, or an instance of a
\class
{
tzinfo
}
subclass. The
remaining arguments may be ints or longs, in the following ranges:
...
...
@@ -1111,7 +1118,7 @@ Constructor:
If an argument outside those ranges is given,
\exception
{
ValueError
}
is raised.
\end{
func
desc}
\end{
class
desc}
Other constructors (class methods):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment