Gets the day of the week of the point in time defined by secs, according to the following table:
| 0 | Monday |
| 1 | Tuesday |
| 2 | Wednesday |
| 3 | Thursday |
| 4 | Friday |
| 5 | Saturday |
| 6 | Sunday |
|
print time.dayofweek() → 0
print time.dayofweek(time.num('2005-05-13'))→ 4
|
Gets the local time in seconds since 0000-01-01 00:00:00. The numeric resolution is down to microseconds, but the actual resolution may be be coarser.
|
print time.get() → 63279080895
print str(time.get(), 1, 4)→ 63279080895.9844
|
See also: .date
Sets the local time in seconds since 0000-01-01 00:00:00 to secs.
|
time.set(time.get() + 60*60) // advance by 1 hour |
Converts the string text into seconds since 0000-01-01 00:00:00, according to the format format.
The format string defines the order of the date and time parts in text. Each part finishes if either a character which is not a digit is encountered, or if the part's maximum length is reached. The parts are denoted by the following characters:
| Character | Max. length | Meaning |
| Y | 4 | Year. |
| M | 2 | Month. |
| D | 2 | Day. |
| h | 2 | Hour (24 hour representation). |
| m | 2 | Minute. |
| s | 2 | Second. |
| t | 3 | Fraction of a second. |
One and two digit years are assumed to be in the 21st century, i.e. 2000 is added to them.
Throws ErrArgument if format contains a character other than those above.
|
print time.get(), time.num(date()) → 63279080895 63279080895
t=time.num("05-03-27")-40*24*3600;print time.str(t) → 2005-02-15 00:00:00
t=time.num('19:14:18.5', 'hmst')+124.7print time.str(t,'hh:mm:ss:ttt') → 19:16:23.200
|
See also: time.str
Converts the seconds since 0000-01-01 00:00:00 secs into a string, according to the format format.
Each character in the format string will be converted into a character in the resulting string, according to the following table:
| Y | Next digit of year |
| M | Next digit of month |
| D | Next digit of day |
| h | Next digit of hour |
| m | Next digit of minute |
| s | Next digit of second |
| t | Next digit of fractions of second |
The format is converted from right to left, except for t.
|
print date(), time.str(time.get()) → 2005-03-14 18:28:15 2005-03-14 18:28:15
print time.str(time.get(), "hh:mm:ss.ttt")→ 18:28:15.424
print time.str(time.get(), "DD.MM.YY")→ 14.03.05
|
Gets the real time in the UTC (Universal Time Coordinate) time zone. This equals Greenwich local time, excluding any shift by daylight saving time.
The difference between local time and UTC time is the local time zone:
|
print time.get() - time.utc() → 3600
|
Gets the week of the year of the point in time defined by secs. The first week in the year is the first week having four or more days in the year defined by secs.
|
print time.weekofyear() → 11
print time.weekofyear(time.num('2005-01-01'))→ 53
|