Date and Time API Functions: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) (→Date) |
||
Zeile 28: | Zeile 28: | ||
== Date == |
== Date == |
||
Date instances represent a date (i.e. "dd-mm-yyyy"). Dates are seldom used - usually timestamps are better suited. |
Date instances represent a date (i.e. "dd-mm-yyyy"). Dates are seldom used - usually timestamps are better suited. |
||
==== Creation ==== |
|||
Date <code>today</code> => a date |
|||
::provides the current date |
|||
== Timestamp == |
== Timestamp == |
Version vom 19. September 2021, 00:07 Uhr
This document lists most useful (and most often needed) functions. Be aware, that there are many more to be found in either the class references or via the builtin class browser.
Reference: Date Time Timestamp TimeDuration
Inhaltsverzeichnis
Time[Bearbeiten]
Time instances represent a time-of-day (i.e. "hh:mm:ss" within a single day). Times are seldom used - usually timestamps are better suited.
Creation[Bearbeiten]
Time now
=> a time
- provides the current time of day
Arithmetic[Bearbeiten]
aTime addSeconds:
nSeconds => a time
aTime addMinutes:
nMinutes => a time
aTime addHours:
nHours => a time
- to compute times
Accessing[Bearbeiten]
aTime hours
=> hours (0..24)
aTime minutes
=> hours (0..59)
aTime seconds
=> hours (0..59)
- to retrieve the hour, minute and second component:
Date[Bearbeiten]
Date instances represent a date (i.e. "dd-mm-yyyy"). Dates are seldom used - usually timestamps are better suited.
Creation[Bearbeiten]
Date today
=> a date
- provides the current date
Timestamp[Bearbeiten]
Timestamp instances represent a particular point in time. (i.e. "dd-mm-yyyy hh:mm:ss").
TimeDuration[Bearbeiten]
Timeduration instances represent a time-delta. (i.e. seconds).
TimeDuration Protocol[Bearbeiten]
Timestamp Protocol[Bearbeiten]
Timestamp now
=> a time
- provides the current timestamp