Calendar represents any time with millisecond precision.
Constructor
Calendar(
int timestamp [,
string timezone])
Calendar(
int year,
int month [,
string timezone])
Calendar(
int year,
int month,
int day [,
string timezone])
Calendar(
int year,
int month,
int day,
int hour [,
string timezone])
Calendar(
int year,
int month,
int day,
int hour,
int minute [,
string timezone])
Calendar(
int year,
int month,
int day,
int hour,
int minute,
int second [,
string timezone])
Calendar(
int tear,
int month,
int day,
int hour,
int minute,
int second,
int millisecond [,
string timezone])
Creates instance of Calendar
| Parameters |
timezone -
ID of timezone, as string
|
Methods
Moves time forward or backward given amount of time units.
Unit depends on given field.
Checks if current time is after the given time.
Checks if current time is before the given time.
See java.text.SimpleDateFormat.
Gets the first day of week.
Gets the last day of week.
Returns the timestamp for this time.
Timestamp is milliseconds since 1.1.1970 00:00.
Checks if given time is on same day as this.
Packs the time into compact string representation.
| Parameters |
level -
Level of detail, between 1 and 6:
1 for year, 2 for month, 3 for day of month,
4 for hour, 5 minute, 6 seconds.
|
Rolls specified field up or down a single unit, or given amount.
When rolling another fields are not affected unless they resulting
time would be non-existents (such as February 31).
| Parameters |
up -
true for up, false for down
amount -
Amount of adjustment for given field, negative value rolls down.
|
Calendar set(
int fieldId,
int setting)
Calendar set(
string fieldId,
int setting)
Calendar set(
int year,
int month,
int day)
Calendar set(
int year,
int month,
int day)
Calendar set(
int year,
int month,
int day,
int hour,
int minute)
Calendar set(
int year,
int month,
int day,
int hour,
int minute,
int second)
Sets the time.
Sets the first day of week.
Sets this time by using timestamp.
Timestamp is milliseconds since 1.1.1970 00:00.
Unpacks packed time and sets this calendar to reflect that time.