Date and Time API Functions: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) (→Date) |
Cg (Diskussion | Beiträge) |
||
| Zeile 68: | Zeile 68: | ||
==== Creation ==== |
==== Creation ==== |
||
Timestamp '''now''' => |
:Timestamp '''now''' => Timestamp |
||
::provides the current timestamp (local time) |
::provides the current timestamp (local time) |
||
UTCTimestamp '''now''' => |
:UTCTimestamp '''now''' => Timestamp |
||
::provides the current timestamp (UTC time) |
::provides the current timestamp (UTC time) |
||
TZTimestamp '''now''' => |
:TZTimestamp '''now''' => Timestamp |
||
::provides the current timestamp (in the local timezone) |
::provides the current timestamp (in the local timezone) |
||
Timestamp '''year:''' ''y'' '''month:''' ''m'' '''day:''' ''d'' '''hour:''' ''h'' '''minute:''' ''min'' '''second:''' ''s'' '''millisecond:''' ''millis'' |
:Timestamp '''year:''' ''y'' '''month:''' ''m'' '''day:''' ''d'' '''hour:''' ''h'' '''minute:''' ''min'' '''second:''' ''s'' '''millisecond:''' ''millis'' |
||
::provides a new local timestamp for the given date and time.<br>Same protocol can be used to get UTCTimestamps and TZTimestamps |
::provides a new local timestamp for the given date and time.<br>Same protocol can be used to get UTCTimestamps and TZTimestamps |
||
Timestamp '''fromDate:''' ''aDate'' ''ándTime:''' ''aTime'' => |
:Timestamp '''fromDate:''' ''aDate'' ''ándTime:''' ''aTime'' => Timestamp |
||
::creates a timestamp from given date and time instances |
::creates a timestamp from given date and time instances |
||
Timestamp '''secondsSince1970:''' ''anInteger'' => |
:Timestamp '''secondsSince1970:''' ''anInteger'' => Timestamp |
||
::creates a timestamp from the given number of seconds. Useful to convert UNIX timestamps. |
::creates a timestamp from the given number of seconds. Useful to convert UNIX timestamps. |
||
Timestamp '''secondsSince1900:''' ''anInteger'' => |
:Timestamp '''secondsSince1900:''' ''anInteger'' => Timestamp |
||
::creates a timestamp from the given number of seconds. Useful to convert NTP timestamps. |
::creates a timestamp from the given number of seconds. Useful to convert NTP timestamps. |
||
==== Conversion ==== |
==== Conversion ==== |
||
''aTimestamp'' '''asUTCTimestamp''' => |
:''aTimestamp'' '''asUTCTimestamp''' => Timestamp |
||
::convert a timestamp to an UTC timestamp |
::convert a timestamp to an UTC timestamp |
||
''aTimestamp'' '''asLocalTimestamp''' => |
:''aTimestamp'' '''asLocalTimestamp''' => Timestamp |
||
::convert a timestamp to a local timestamp (i.e. no timezone info) |
::convert a timestamp to a local timestamp (i.e. no timezone info) |
||
''aTimestamp'' '''asTZTimestamp''' => |
:''aTimestamp'' '''asTZTimestamp''' => Timestamp |
||
::convert a timestamp to a timestamp for your timezone |
::convert a timestamp to a timestamp for your timezone |
||
''aTimestamp'' '''asTZTimestamp:''' ''utcOffsetInSeconds'' => |
:''aTimestamp'' '''asTZTimestamp:''' ''utcOffsetInSeconds'' => Timestamp |
||
::convert a timestamp to a timestamp with the given tz offset |
::convert a timestamp to a timestamp with the given tz offset |
||
''aTimestamp'' '''asTZTimestampInZone:''' ''nameOfTimeZone'' => |
:''aTimestamp'' '''asTZTimestampInZone:''' ''nameOfTimeZone'' => Timestamp |
||
::convert a timestamp to a timestamp in the given timezone. |
::convert a timestamp to a timestamp in the given timezone. |
||
::for example to get the current time in NewYork, use " Timestamp now asTZTimestampInZone:'EST' "<br>and to get the time in Stuttgart, use " Timestamp now asTZTimestampInZone:'MEZ' " |
:::for example to get the current time in NewYork, use " Timestamp now asTZTimestampInZone:'EST' "<br>and to get the time in Stuttgart, use " Timestamp now asTZTimestampInZone:'MEZ' " |
||
''aTimestamp'' '''asDate''' => |
:''aTimestamp'' '''asDate''' => Date |
||
::convert a timestamp to a date (i.e. forgets the time information). Mainly useful for printing. |
::convert a timestamp to a date (i.e. forgets the time information). Mainly useful for printing. |
||
''aTimestamp'' '''asTime''' => |
:''aTimestamp'' '''asTime''' => Time |
||
::convert a timestamp to a time (i.e. forgets the date information). Mainly useful for printing. |
::convert a timestamp to a time (i.e. forgets the date information). Mainly useful for printing. |
||
==== Accessing ==== |
==== Accessing ==== |
||
''aTimestamp'' '''day''' => |
:''aTimestamp'' '''day''' => Integer |
||
::the day in month (1 .. 31) |
::the day in month (1 .. 31) |
||
''aTimestamp'' '''month''' => |
:''aTimestamp'' '''month''' => Integer |
||
::the month in year (1 .. 12) |
::the month in year (1 .. 12) |
||
''aTimestamp'' '''year''' => |
:''aTimestamp'' '''year''' => Integer |
||
::the year |
::the year |
||
''aTimestamp'' '''hours''' => |
:''aTimestamp'' '''hours''' => Integer |
||
::the hour within the day (0..23) |
::the hour within the day (0..23) |
||
''aTimestamp'' '''minutes''' => |
:''aTimestamp'' '''minutes''' => Integer |
||
::the minutes within the hour (0 .. 59) |
::the minutes within the hour (0 .. 59) |
||
''aTimestamp'' '''seconds''' => |
:''aTimestamp'' '''seconds''' => Integer |
||
::the seconds within the minute (0 .. 59) |
::the seconds within the minute (0 .. 59) |
||
''aTimestamp'' '''milliSeconds''' => |
:''aTimestamp'' '''milliSeconds''' => Integer |
||
::the truncated milliseconds within the second (0 .. 999) |
::the truncated milliseconds within the second (0 .. 999) |
||
''aTimestamp'' '''microSeconds''' => |
:''aTimestamp'' '''microSeconds''' => Integer |
||
::the truncated microseconds within the second (0 .. 999999). If the timestamp was acquired from an operating system which does not provide that precision, these will be the milliseconds * 1000. |
::the truncated microseconds within the second (0 .. 999999). If the timestamp was acquired from an operating system which does not provide that precision, these will be the milliseconds * 1000. |
||
''aTimestamp'' '''nanoSeconds''' => |
:''aTimestamp'' '''nanoSeconds''' => Integer |
||
::the truncated nanoseconds within the second (0 .. 999999999). Will be microseconds * 1000 if the source did not provide the precision. |
::the truncated nanoseconds within the second (0 .. 999999999). Will be microseconds * 1000 if the source did not provide the precision. |
||
''aTimestamp'' '''picoSeconds''' => |
:''aTimestamp'' '''picoSeconds''' => Integer |
||
::the picoseconds within the second (0 .. 999999999999). Will be nanoseconds * 1000 if the source did not provide the precision |
::the picoseconds within the second (0 .. 999999999999). Will be nanoseconds * 1000 if the source did not provide the precision |
||
''aTimestamp'' '''exactMilliSeconds''' => |
:''aTimestamp'' '''exactMilliSeconds''' => Number |
||
::the exact milliseconds within the second as integer (0 .. 999) or fixed point number (0 .. 999.xxx) |
::the exact milliseconds within the second as integer (0 .. 999) or fixed point number (0 .. 999.xxx) |
||
''aTimestamp'' '''exactMicroSeconds''' => |
:''aTimestamp'' '''exactMicroSeconds''' => Number |
||
::the exact microseconds within the second |
::the exact microseconds within the second |
||
''aTimestamp'' '''exactNanoSeconds''' => |
:''aTimestamp'' '''exactNanoSeconds''' => Number |
||
::the exact nanoseconds within the second |
::the exact nanoseconds within the second |
||
''aTimestamp'' '''dayInWeek''' => |
:''aTimestamp'' '''dayInWeek''' => Integer |
||
::the weekday in European numbering (1=Monday) |
::the weekday in European numbering (1=Monday) |
||
''aTimestamp'' '''dayOfWeek''' => |
:''aTimestamp'' '''dayOfWeek''' => Integer |
||
::the weekday in US numbering (1=Sunday) |
::the weekday in US numbering (1=Sunday) |
||
''aTimestamp'' '''dayInYear''' => |
:''aTimestamp'' '''dayInYear''' => Integer |
||
::the day within the year (1=1st January) |
::the day within the year (1=1st January) |
||
''aTimestamp'' '''weekInYear''' => |
:''aTimestamp'' '''weekInYear''' => Integer |
||
::the week-number within the year. The returned week number starts with 1 for the first week which has a thursday in it (see DIN 1355-1/ISO 8601). Be prepared: by definition this can lead to the 1st week starting in the old year! |
::the week-number within the year. The returned week number starts with 1 for the first week which has a thursday in it (see DIN 1355-1/ISO 8601). Be prepared: by definition this can lead to the 1st week starting in the old year! |
||
==== Queries ==== |
==== Queries ==== |
||
''aTimestamp'' '''utcSecondsSince1900''' => Integer |
:''aTimestamp'' '''utcSecondsSince1900''' => Integer |
||
::the number of seconds since 1.1.1900; timestamps are often represented as such in communication protocols (eg. [https://en.wikipedia.org/wiki/Network_Time_Protocol NTP] and [https://de.wikipedia.org/wiki/Open_Sound_Control OSC]) |
::the number of seconds since 1.1.1900; timestamps are often represented as such in communication protocols (eg. [https://en.wikipedia.org/wiki/Network_Time_Protocol NTP] and [https://de.wikipedia.org/wiki/Open_Sound_Control OSC]) |
||
''aTimestamp'' '''utcSecondsSince1901''' => Integer |
:''aTimestamp'' '''utcSecondsSince1901''' => Integer |
||
::the number of seconds since 1.1.1901; timestamps are sometimes represented as such in communication protocols |
::the number of seconds since 1.1.1901; timestamps are sometimes represented as such in communication protocols |
||
''aTimestamp'' '''utcSecondsSince1970''' => Integer |
:''aTimestamp'' '''utcSecondsSince1970''' => Integer |
||
::the number of seconds since 1.1.1970; UNIX timestamps are represented as such in communication protocols |
::the number of seconds since 1.1.1970; UNIX timestamps are represented as such in communication protocols |
||
==== Printing ==== |
==== Printing ==== |
||
''aTimestamp'' '''printStringRFC1123Format''' => String |
:''aTimestamp'' '''printStringRFC1123Format''' => String |
||
::a string representation as in RFC1123.<br>For example, " 'Wed, 05 Jan 2022 19:41:31 GMT' " |
::a string representation as in RFC1123.<br>For example, " 'Wed, 05 Jan 2022 19:41:31 GMT' " |
||
''aTimestamp'' '''printRFC1123FormatOn:''' ''aStream'' => void |
:''aTimestamp'' '''printRFC1123FormatOn:''' ''aStream'' => void |
||
::append the RFC1123 representation to a stream.<br>Eg. " Timestamp now printRFC1123FormatOn: Transcript ". |
::append the RFC1123 representation to a stream.<br>Eg. " Timestamp now printRFC1123FormatOn: Transcript ". |
||
''aTimestamp'' '''printStringIso8601''' => String |
:''aTimestamp'' '''printStringIso8601''' => String |
||
::generates a string representation as defined in Iso8601.<br>For example, " '2022-01-05T20:43:55.068' " |
::generates a string representation as defined in Iso8601.<br>For example, " '2022-01-05T20:43:55.068' " |
||
''aTimestamp'' '''printIso8601FormatOn:''' ''aStream'' => void |
:''aTimestamp'' '''printIso8601FormatOn:''' ''aStream'' => void |
||
::append the Iso8601 representation to a stream.<br>Eg. " Timestamp now printIso8601FormatOn: Transcript ". |
::append the Iso8601 representation to a stream.<br>Eg. " Timestamp now printIso8601FormatOn: Transcript ". |
||
''aTimestamp'' '''printStringIso8601Compressed''' => String |
:''aTimestamp'' '''printStringIso8601Compressed''' => String |
||
:: generates a compressed string representation as defined in Iso8601.<br>For example, " ''20220105T204544.828'' " |
:: generates a compressed string representation as defined in Iso8601.<br>For example, " ''20220105T204544.828'' " |
||
''aTimestamp'' '''printIso8601CompressedOn:''' ''aStream'' => void |
:''aTimestamp'' '''printIso8601CompressedOn:''' ''aStream'' => void |
||
::append the compressed Iso8601 representation to a stream.<br>Eg. " Timestamp now printIso8601CompressedOn: Transcript ". |
::append the compressed Iso8601 representation to a stream.<br>Eg. " Timestamp now printIso8601CompressedOn: Transcript ". |
||
''aTimestamp'' '''printStringFormat:''' ''formatString'' => String |
:''aTimestamp'' '''printStringFormat:''' ''formatString'' => String |
||
:: generates a string representation as specified in formatString.<br>For example, " Timestamp now printStringFormat:'%h:%m:%s' " might generate a string like " '20:48:47' "<br>Valid format characters are<br>"%h" (hour 24 padded),"%m" (minutes),"%s" (seconds),"%i" (millis),"%j" (micros),<br>"%(day)" (day-nr in month), "%(month)" (month-nr), "%(year)" (year),<br>"%H" (hour 24 unpadded), "%M" (minutes unpadded), "%S" (seconds unpadded),<br>"%(milli)" (millis), "%(milli1)" (millis, 1 digit), "%(milli3)" (millis, 3 digits),<br>"%(micro)" (micros), "%(micro6)" (micros, 6 digits),<br>"%(nano)" (nanos), "%(nano9)" (nanos, 9 digits),<br>"%(pico)" (picos), "%(pico12)" (picos, 12 digits),<br>"%(weekDay)" (1 to 7), "%(dayName)" (in current language), "%(monthName)" (in current language), "%(shortDayName)" (in current language), "%(shortMonthName)" (in current language). For a full list, see the [https://live.exept.de/ClassDoc/classDocOf:,AbstractTime#AbstractTime_category_printing%20&%20storing AbstractTime class documentation]. |
:: generates a string representation as specified in formatString.<br>For example, " Timestamp now printStringFormat:'%h:%m:%s' " might generate a string like " '20:48:47' "<br>Valid format characters are<br>"%h" (hour 24 padded),"%m" (minutes),"%s" (seconds),"%i" (millis),"%j" (micros),<br>"%(day)" (day-nr in month), "%(month)" (month-nr), "%(year)" (year),<br>"%H" (hour 24 unpadded), "%M" (minutes unpadded), "%S" (seconds unpadded),<br>"%(milli)" (millis), "%(milli1)" (millis, 1 digit), "%(milli3)" (millis, 3 digits),<br>"%(micro)" (micros), "%(micro6)" (micros, 6 digits),<br>"%(nano)" (nanos), "%(nano9)" (nanos, 9 digits),<br>"%(pico)" (picos), "%(pico12)" (picos, 12 digits),<br>"%(weekDay)" (1 to 7), "%(dayName)" (in current language), "%(monthName)" (in current language), "%(shortDayName)" (in current language), "%(shortMonthName)" (in current language). For a full list, see the [https://live.exept.de/ClassDoc/classDocOf:,AbstractTime#AbstractTime_category_printing%20&%20storing AbstractTime class documentation]. |
||
''aTimestamp'' '''printOn:''' ''aStream'' '''format:''' ''formatString'' => void |
:''aTimestamp'' '''printOn:''' ''aStream'' '''format:''' ''formatString'' => void |
||
::same as above, but the string is sent to aStream. |
::same as above, but the string is sent to aStream. |
||
Version vom 14. Januar 2022, 22:12 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.
However, there are a number of useful query function provided on the class side.
Creation[Bearbeiten]
- Date today => a date
- provides the current date
- Date tomorrow => a date
- provides the date of tomorrow
- Date yesterday => a date
- provides the date of yesterday
- Date year: yearNr month: monthNr day: dayNr => a date
- for example, "(Date year:2025 month:4 day:20)" generates 20-04-2025 (i.e. 20th April 2025)
Arithmetic[Bearbeiten]
- aDate addDays: numDays => a date
- to compute a date numDays after aDate
- aDate subtractDays: numDays => a date
- to compute a date numDays before aDate; for example: "(Date today subtractDays:7)"
- aDate subtractDate: date2 => nr of days
- to compute the number of days since 1.1.1900, use: "(Date today subtractDate:(Date year:1900 month:1 day:1))"
Accessing[Bearbeiten]
- aDate day => day (1..31)
- aDate month => month (1..12)
- aDate year => year
- to retrieve date components.
Timestamp[Bearbeiten]
Timestamp instances represent a particular point in time. (i.e. "dd-mm-yyyy hh:mm:ss"). Conceptionally, they combine Date and Time with a higher resolution into one object. Timestamps can be created from strings or acquired from the operating system (although the precision varies among Operating systems - some will only provide millisecond resolution, others provide nanosecond resolution.
In contrast to the operating system's time information, Timestamps can represent times before 1970/1900 and after 2036. However, there is currently no support for pre-Gregorian dates.
Timestamps can be either local timestamps, UTC timestamps or timezone-specific timestamps, and are then instances of one of the classes Timestamp, UTCTimestamp or TZTimestamp.
Creation[Bearbeiten]
- Timestamp now => Timestamp
- provides the current timestamp (local time)
- UTCTimestamp now => Timestamp
- provides the current timestamp (UTC time)
- TZTimestamp now => Timestamp
- provides the current timestamp (in the local timezone)
- Timestamp year: y month: m day: d hour: h minute: min second: s millisecond: millis
- provides a new local timestamp for the given date and time.
Same protocol can be used to get UTCTimestamps and TZTimestamps
- provides a new local timestamp for the given date and time.
- Timestamp fromDate:' aDate ándTime: aTime => Timestamp
- creates a timestamp from given date and time instances
- Timestamp secondsSince1970: anInteger => Timestamp
- creates a timestamp from the given number of seconds. Useful to convert UNIX timestamps.
- Timestamp secondsSince1900: anInteger => Timestamp
- creates a timestamp from the given number of seconds. Useful to convert NTP timestamps.
Conversion[Bearbeiten]
- aTimestamp asUTCTimestamp => Timestamp
- convert a timestamp to an UTC timestamp
- aTimestamp asLocalTimestamp => Timestamp
- convert a timestamp to a local timestamp (i.e. no timezone info)
- aTimestamp asTZTimestamp => Timestamp
- convert a timestamp to a timestamp for your timezone
- aTimestamp asTZTimestamp: utcOffsetInSeconds => Timestamp
- convert a timestamp to a timestamp with the given tz offset
- aTimestamp asTZTimestampInZone: nameOfTimeZone => Timestamp
- convert a timestamp to a timestamp in the given timezone.
- for example to get the current time in NewYork, use " Timestamp now asTZTimestampInZone:'EST' "
and to get the time in Stuttgart, use " Timestamp now asTZTimestampInZone:'MEZ' "
- for example to get the current time in NewYork, use " Timestamp now asTZTimestampInZone:'EST' "
- convert a timestamp to a timestamp in the given timezone.
- aTimestamp asDate => Date
- convert a timestamp to a date (i.e. forgets the time information). Mainly useful for printing.
- aTimestamp asTime => Time
- convert a timestamp to a time (i.e. forgets the date information). Mainly useful for printing.
Accessing[Bearbeiten]
- aTimestamp day => Integer
- the day in month (1 .. 31)
- aTimestamp month => Integer
- the month in year (1 .. 12)
- aTimestamp year => Integer
- the year
- aTimestamp hours => Integer
- the hour within the day (0..23)
- aTimestamp minutes => Integer
- the minutes within the hour (0 .. 59)
- aTimestamp seconds => Integer
- the seconds within the minute (0 .. 59)
- aTimestamp milliSeconds => Integer
- the truncated milliseconds within the second (0 .. 999)
- aTimestamp microSeconds => Integer
- the truncated microseconds within the second (0 .. 999999). If the timestamp was acquired from an operating system which does not provide that precision, these will be the milliseconds * 1000.
- aTimestamp nanoSeconds => Integer
- the truncated nanoseconds within the second (0 .. 999999999). Will be microseconds * 1000 if the source did not provide the precision.
- aTimestamp picoSeconds => Integer
- the picoseconds within the second (0 .. 999999999999). Will be nanoseconds * 1000 if the source did not provide the precision
- aTimestamp exactMilliSeconds => Number
- the exact milliseconds within the second as integer (0 .. 999) or fixed point number (0 .. 999.xxx)
- aTimestamp exactMicroSeconds => Number
- the exact microseconds within the second
- aTimestamp exactNanoSeconds => Number
- the exact nanoseconds within the second
- aTimestamp dayInWeek => Integer
- the weekday in European numbering (1=Monday)
- aTimestamp dayOfWeek => Integer
- the weekday in US numbering (1=Sunday)
- aTimestamp dayInYear => Integer
- the day within the year (1=1st January)
- aTimestamp weekInYear => Integer
- the week-number within the year. The returned week number starts with 1 for the first week which has a thursday in it (see DIN 1355-1/ISO 8601). Be prepared: by definition this can lead to the 1st week starting in the old year!
Queries[Bearbeiten]
- aTimestamp utcSecondsSince1900 => Integer
- aTimestamp utcSecondsSince1901 => Integer
- the number of seconds since 1.1.1901; timestamps are sometimes represented as such in communication protocols
- aTimestamp utcSecondsSince1970 => Integer
- the number of seconds since 1.1.1970; UNIX timestamps are represented as such in communication protocols
Printing[Bearbeiten]
- aTimestamp printStringRFC1123Format => String
- a string representation as in RFC1123.
For example, " 'Wed, 05 Jan 2022 19:41:31 GMT' "
- a string representation as in RFC1123.
- aTimestamp printRFC1123FormatOn: aStream => void
- append the RFC1123 representation to a stream.
Eg. " Timestamp now printRFC1123FormatOn: Transcript ".
- append the RFC1123 representation to a stream.
- aTimestamp printStringIso8601 => String
- generates a string representation as defined in Iso8601.
For example, " '2022-01-05T20:43:55.068' "
- generates a string representation as defined in Iso8601.
- aTimestamp printIso8601FormatOn: aStream => void
- append the Iso8601 representation to a stream.
Eg. " Timestamp now printIso8601FormatOn: Transcript ".
- append the Iso8601 representation to a stream.
- aTimestamp printStringIso8601Compressed => String
- generates a compressed string representation as defined in Iso8601.
For example, " 20220105T204544.828 "
- generates a compressed string representation as defined in Iso8601.
- aTimestamp printIso8601CompressedOn: aStream => void
- append the compressed Iso8601 representation to a stream.
Eg. " Timestamp now printIso8601CompressedOn: Transcript ".
- append the compressed Iso8601 representation to a stream.
- aTimestamp printStringFormat: formatString => String
- generates a string representation as specified in formatString.
For example, " Timestamp now printStringFormat:'%h:%m:%s' " might generate a string like " '20:48:47' "
Valid format characters are
"%h" (hour 24 padded),"%m" (minutes),"%s" (seconds),"%i" (millis),"%j" (micros),
"%(day)" (day-nr in month), "%(month)" (month-nr), "%(year)" (year),
"%H" (hour 24 unpadded), "%M" (minutes unpadded), "%S" (seconds unpadded),
"%(milli)" (millis), "%(milli1)" (millis, 1 digit), "%(milli3)" (millis, 3 digits),
"%(micro)" (micros), "%(micro6)" (micros, 6 digits),
"%(nano)" (nanos), "%(nano9)" (nanos, 9 digits),
"%(pico)" (picos), "%(pico12)" (picos, 12 digits),
"%(weekDay)" (1 to 7), "%(dayName)" (in current language), "%(monthName)" (in current language), "%(shortDayName)" (in current language), "%(shortMonthName)" (in current language). For a full list, see the AbstractTime class documentation.
- generates a string representation as specified in formatString.
- aTimestamp printOn: aStream format: formatString => void
- same as above, but the string is sent to aStream.
TimeDuration[Bearbeiten]
Timeduration instances represent a time-delta. (i.e. seconds + fractional seconds). Timedurations are typically returned when timestamps are subtracted. They provide a protocol similar to the above described Time protocol (albeit with a higher resolution).