xlang v5.1 Release
程序设计语言基础库文档
|
提供日期和时间的操作与管理功能的类。 更多...
Public 成员函数 |
静态 Public 成员函数 |
静态 Public 属性 |
提供日期和时间的操作与管理功能的类。
Calendar类用于表示和操作日历时间,包括年、月、日、时、分、秒等字段,并支持时区和夏令时偏移。 提供了设置、获取、比较、清除时间等方法,以及静态常量用于标识各种日历字段和样式。
在文件 Calendar.x 第 8 行定义.
Calendar | ( | ) |
构造一个新的Calendar对象,初始化为当前时间。
void clear | ( | ) |
清除所有字段的值。
void clear | ( | int | field | ) |
清除指定字段的值。
field | 字段常量。 |
int compareTo | ( | Calendar | another | ) |
比较两个Calendar对象的时间先后。
another | 另一个Calendar对象。 |
void finalize | ( | ) |
释放资源,进行对象终结。
int get | ( | int | field | ) |
获取指定字段的值。
field | 字段常量,如YEAR、MONTH等。 |
|
static |
获取默认的Calendar实例。
|
static |
获取指定时区的Calendar实例。
offset | 时区偏移量(单位:毫秒)。 |
String getTime | ( | ) |
获取当前时间的字符串表示。
long getTimeInMillis | ( | ) |
获取当前时间(毫秒)。
int getTimeZoneOffset | ( | ) |
获取时区偏移量。
void set | ( | int | field, |
int | value | ||
) |
设置指定字段的值。
field | 字段常量。 |
value | 要设置的值。 |
void set | ( | int | year, |
int | month, | ||
int | date | ||
) |
设置年、月、日。
year | 年份。 |
month | 月份。 |
date | 日期。 |
void set | ( | int | year, |
int | month, | ||
int | date, | ||
int | hourOfDay, | ||
int | minute, | ||
int | second | ||
) |
设置年、月、日、时、分、秒。
year | 年份。 |
month | 月份。 |
date | 日期。 |
hourOfDay | 小时(24小时制)。 |
minute | 分钟。 |
second | 秒。 |
void setTimeInMillis | ( | long | millis | ) |
设置时间(毫秒)。
millis | 要设置的时间,单位为毫秒。 |
void setTimeZoneOffset | ( | int | offset | ) |
设置时区偏移量。
offset | 时区偏移量(单位:毫秒)。 |
String toString | ( | ) |
获取Calendar对象的字符串表示。
|
static |
所有样式常量。
在文件 Calendar.x 第 92 行定义.
|
static |
上午常量。
在文件 Calendar.x 第 88 行定义.
|
static |
上午/下午字段常量。
在文件 Calendar.x 第 30 行定义.
|
static |
四月常量。
在文件 Calendar.x 第 68 行定义.
|
static |
八月常量。
在文件 Calendar.x 第 76 行定义.
|
static |
日期字段常量。
在文件 Calendar.x 第 20 行定义.
|
static |
月中的天字段常量。
在文件 Calendar.x 第 22 行定义.
|
static |
星期字段常量。
在文件 Calendar.x 第 26 行定义.
|
static |
月中的星期字段常量。
在文件 Calendar.x 第 28 行定义.
|
static |
年中的天字段常量。
在文件 Calendar.x 第 24 行定义.
|
static |
十二月常量。
在文件 Calendar.x 第 84 行定义.
|
static |
夏令时偏移字段常量。
在文件 Calendar.x 第 44 行定义.
|
static |
纪元字段常量。
在文件 Calendar.x 第 10 行定义.
|
static |
二月常量。
在文件 Calendar.x 第 64 行定义.
|
static |
字段总数常量。
在文件 Calendar.x 第 46 行定义.
|
static |
星期五常量。
在文件 Calendar.x 第 58 行定义.
|
static |
小时字段常量(12小时制)。
在文件 Calendar.x 第 32 行定义.
|
static |
小时字段常量(24小时制)。
在文件 Calendar.x 第 34 行定义.
|
static |
一月常量。
在文件 Calendar.x 第 62 行定义.
|
static |
七月常量。
在文件 Calendar.x 第 74 行定义.
|
static |
六月常量。
在文件 Calendar.x 第 72 行定义.
|
static |
长样式常量。
在文件 Calendar.x 第 98 行定义.
|
static |
长格式样式常量。
在文件 Calendar.x 第 106 行定义.
|
static |
长独立样式常量。
在文件 Calendar.x 第 110 行定义.
|
static |
三月常量。
在文件 Calendar.x 第 66 行定义.
|
static |
五月常量。
在文件 Calendar.x 第 70 行定义.
|
static |
毫秒字段常量。
在文件 Calendar.x 第 40 行定义.
|
static |
分钟字段常量。
在文件 Calendar.x 第 36 行定义.
|
static |
星期一常量。
在文件 Calendar.x 第 50 行定义.
|
static |
月份字段常量。
在文件 Calendar.x 第 14 行定义.
|
static |
狭窄格式样式常量。
在文件 Calendar.x 第 100 行定义.
|
static |
狭窄独立样式常量。
在文件 Calendar.x 第 102 行定义.
|
static |
十一月常量。
在文件 Calendar.x 第 82 行定义.
|
static |
十月常量。
在文件 Calendar.x 第 80 行定义.
|
static |
下午常量。
在文件 Calendar.x 第 90 行定义.
|
static |
星期六常量。
在文件 Calendar.x 第 60 行定义.
|
static |
秒字段常量。
在文件 Calendar.x 第 38 行定义.
|
static |
九月常量。
在文件 Calendar.x 第 78 行定义.
|
static |
简短样式常量。
在文件 Calendar.x 第 96 行定义.
|
static |
简短格式样式常量。
在文件 Calendar.x 第 104 行定义.
|
static |
简短独立样式常量。
在文件 Calendar.x 第 108 行定义.
|
static |
独立样式掩码常量。
在文件 Calendar.x 第 94 行定义.
|
static |
星期日常量。
在文件 Calendar.x 第 48 行定义.
|
static |
星期四常量。
在文件 Calendar.x 第 56 行定义.
|
static |
星期二常量。
在文件 Calendar.x 第 52 行定义.
|
static |
第十三月常量(用于某些历法)。
在文件 Calendar.x 第 86 行定义.
|
static |
星期三常量。
在文件 Calendar.x 第 54 行定义.
|
static |
月中的周字段常量。
在文件 Calendar.x 第 18 行定义.
|
static |
年中的周字段常量。
在文件 Calendar.x 第 16 行定义.
|
static |
年份字段常量。
在文件 Calendar.x 第 12 行定义.
|
static |
时区偏移字段常量。
在文件 Calendar.x 第 42 行定义.