|
|
6.165 Time
- Defined in namespace Smalltalk
- Category: Language-Data types
- My instances represent times of the day. I provide methods for instance
creation, methods that access components (hours, minutes, and seconds) of a
time value, and a block execution timing facility.
6.165.1 Time class: basic (UTC)
- utcNow
- Answer a time representing the current time of day in Coordinated Universal Time (UTC)
- utcSecondClock
- Answer the number of seconds since the midnight of 1/1/1901 (unlike #secondClock, the reference time is here expressed as UTC, that is as Coordinated Universal Time).
6.165.2 Time class: builtins
- primMillisecondClock
- Returns the number of milliseconds since midnight.
- primSecondClock
- Returns the number of seconds to/from 1/1/2000.
- timezone
- Answer a String associated with the current timezone (either standard or daylight-saving) on this operating system. For example, the answer could be `EST' to indicate Eastern Standard Time; the answer can be empty and can't be assumed to be a three-character code such as `EST'.
- timezoneBias
- Specifies the current bias, in minutes, for local time translation for the current time. The bias is the difference, in seconds, between Coordinated Universal Time (UTC) and local time; a positive bias indicates that the local timezone is to the east of Greenwich (e.g. Europe, Asia), while a negative bias indicates that it is to the west (e.g. America)
6.165.3 Time class: clocks
- millisecondClock
- Answer the number of milliseconds since startup.
- millisecondClockValue
- Answer the number of milliseconds since startup
- millisecondsPerDay
- Answer the number of milliseconds in a day
- millisecondsToRun: timedBlock
- Answer the number of milliseconds which timedBlock took to run
- secondClock
- Answer the number of seconds since the midnight of 1/1/1901
6.165.4 Time class: initialization
- initialize
- Initialize the Time class after the image has been bootstrapped
- update: aspect
- Private - Initialize the receiver's instance variables
6.165.5 Time class: instance creation
- fromSeconds: secondCount
- Answer a Time representing secondCount seconds past midnight
- hours: h
- Answer a Time that is the given number of hours past midnight
- hours: h minutes: m seconds: s
- Answer a Time that is the given number of hours, minutes and seconds past midnight
- minutes: m
- Answer a Time that is the given number of minutes past midnight
- new
- Answer a Time representing midnight
- now
- Answer a time representing the current time of day
- readFrom: aStream
- Parse an instance of the receiver (hours/minutes/seconds) from aStream
- seconds: s
- Answer a Time that is the given number of seconds past midnight
6.165.6 Time: accessing (ANSI for DateAndTimes)
- hour
- Answer the number of hours in the receiver
- hour12
- Answer the hour in a 12-hour clock
- hour24
- Answer the hour in a 24-hour clock
- minute
- Answer the number of minutes in the receiver
- second
- Answer the number of seconds in the receiver
6.165.7 Time: accessing (non ANSI & for Durations)
- asSeconds
- Answer `seconds'.
- hours
- Answer the number of hours in the receiver
- minutes
- Answer the number of minutes in the receiver
- seconds
- Answer the number of seconds in the receiver
6.165.8 Time: arithmetic
- addTime: timeAmount
- Answer a new Time that is timeAmount seconds after the receiver
- printOn: aStream
- Print a representation of the receiver on aStream
- subtractTime: timeAmount
- Answer a new Time that is timeAmount seconds before the receiver
6.165.9 Time: comparing
- < aTime
- Answer whether the receiver is less than aTime
- = aTime
- Answer whether the receiver is equal to aTime
- hash
- Answer an hash value for the receiver
|