Category: Language-Data types
Superclass: Date
My instances represent timestamps.

Method category index

information (class)
instance creation (class)
instance creation (non-ANSI) (class)
basic (instance)
computations (instance)
printing (instance)
splitting in dates & times (instance)
storing (instance)
testing (instance)
time zones (instance)

information (class)

clockPrecision
Answer `ClockPrecision'.

initialize

Initialize the receiver's class variables

top


instance creation (class)

now
Answer an instance of the receiver referring to the current date and time.

readFrom: aStream

Parse an instance of the receiver from aStream

today

Answer an instance of the receiver referring to midnight of today in local time.

year: y day: d hour: h minute: min second: s

Answer a DateTime denoting the d-th day of the given year, and setting the time part to the given hour, minute, and second

year: y day: d hour: h minute: min second: s offset: ofs

Answer a DateTime denoting the d-th day of the given year. Set the offset field to ofs (a Duration), and the time part to the given hour, minute, and second

year: y month: m day: d hour: h minute: min second: s

Answer a DateTime denoting the d-th day of the given (as a number) month and year, setting the time part to the given hour, minute, and second

year: y month: m day: d hour: h minute: min second: s offset: ofs

Answer a DateTime denoting the d-th day of the given (as a number) month and year. Set the offset field to ofs (a Duration), and the the time part to the given hour, minute, and second

top


instance creation (non-ANSI) (class)

date: aDate time: aTime
Answer a DateTime denoting the given date and time. Set the offset field to ofs (a Duration).

date: aDate time: aTime offset: ofs

Answer a DateTime denoting the given date and time. Set the offset field to ofs (a Duration).

fromDays: days seconds: secs

Answer a DateTime denoting the given date (as days since January 1, 1901) and time (as seconds since UTC midnight).

fromDays: days seconds: secs offset: ofs

Answer a DateTime denoting the given date (as days since January 1, 1901) and time (as seconds since midnight). Set the offset field to ofs (a Duration).

fromSeconds: secs

Answer a DateTime denoting the given date and time (as seconds since January 1, 1901 midnight UTC).

fromSeconds: secs offset: ofs

Answer a DateTime denoting the given date and time (as seconds since January 1, 1901 midnight). Set the offset field to ofs (a Duration).

top


basic (instance)

+ aDuration
Answer a new Date pointing aDuration time past the receiver

- aDateTimeOrDuration

Answer a new Date pointing dayCount before the receiver

top


computations (instance)

asSeconds
Answer the date as the number of seconds from 1/1/1901.

dayOfWeek

Answer the day of week of the receiver. Unlike Dates, DateAndTimes have 1 = Sunday, 7 = Saturday

hour

Answer the hour in a 24-hour clock

hour12

Answer the hour in a 12-hour clock

hour24

Answer the hour in a 24-hour clock

meridianAbbreviation

Answer either #AM (for anti-meridian) or #PM (for post-meridian)

minute

Answer the minute

second

Answer the month represented by the receiver

top


printing (instance)

printOn: aStream
Print a representation for the receiver on aStream

top


splitting in dates & times (instance)

asDate
Answer a Date referring to the same day as the receiver

asTime

Answer a Time referring to the same time (from midnight) as the receiver

at: anIndex

Since in the past timestamps were referred to as Arrays containing a Date and a Time (in this order), this method provides access to DateTime objects like if they were two-element Arrays.

top


storing (instance)

storeOn: aStream
Store on aStream Smalltalk code compiling to the receiver

top


testing (instance)

< aDateTime
Answer whether the receiver indicates a date preceding aDate

= aDateTime

Answer whether the receiver indicates the same date as aDate

hash

Answer an hash value for the receievr

top


time zones (instance)

asLocal
Answer the receiver, since DateTime objects store themselves in Local time

asUTC

Convert the receiver to UTC time, and answer a new DateTime object.

offset

Answer the receiver's offset from UTC to local time (e.g. +3600 seconds for Central Europe Time, -3600*6 seconds for Eastern Standard Time). The offset is expressed as a Duration

offset: anOffset

Answer a copy of the receiver with the offset from UTC to local time changed to anOffset (a Duration).

timeZoneAbbreviation

Answer an abbreviated indication of the receiver's offset, expressed as `shhmm', where `hh' is the number of hours and `mm' is the number of minutes between UTC and local time, and `s' can be `+' for the Eastern hemisphere and `-' for the Western hemisphere.

timeZoneName

Answer the time zone name for the receiver (currently, it is simply `GMT +xxxx', where `xxxx' is the receiver's #timeZoneAbbreviation).

top