Package: Kernel-Dates
Class: Date
Introduction
Environment: container
A Date is an object which holds a specific point in time, from year to seconds.
Currently, there are hard-coded strings for days of the week (Monday - Sunday) as well as months in a year (January - December), and also their abbreviations.
Both days of week and months in year are indexed starting with 1 (Monday and January).
Most of the available functions use the Date class instead of a Date instance.
For example:
Class Method
Category: accessing
abbreviationOfDay:
- Answer the abbreviated name of the day of week corresponding to the given index (1=Mon, 7=Sun based).For example:
dayOfWeek:
- Answer the index of the day of week corresponding to the given name (1=Monday, 7=Sunday based).For example:
daysInMonth:forYear:
- Answer the number of days in the given (named) month for the given year.For example:
daysInYear:
- Answer the number of days in the given year.For example:
indexOfMonth:
- Answer the index of the month corresponding to the given name (1=January based).For example:
nameOfDay:
- Answer the name of the day of week corresponding to the given index (1=Monday, 7=Sunday based).For example:
nameOfMonth:
- Answer the name of the month corresponding to the given index (1=January based).For example:
shortNameOfMonth:
- Answer the name of the month corresponding to the given index (1=January based).For example:
Category: instance creation
year:day:hour:minute:second:
- Answer a Date denoting the d-th day of the given year.For example:
year:month:day:hour:minute:second:
- Answer a Date denoting the d-th day of the given (as a number) month and year.For example:
Last updated