使用范围:WX
class Date ($UI/wxsys/lib/base/date)
常用的日期操作
Constructor Top
Date () |
Static Properties & Enumerations Top
String |
DEFAULT_FORMAT
[filed]时间格式常量 = "yyyy/MM/dd hh:mm:ss" | ||
String |
DEFAULT_FORMAT1
[filed]时间格式常量 = "yyyy-MM-dd hh:mm:ss" | ||
String |
DEFAULT_FORMAT_SHOT
[filed]时间格式常量 = "yyyy/MM/dd" | ||
String |
STANDART_FORMAT
[filed]时间格式常量 = "yyyy-MM-ddThh:mm:ss.fffZ" | ||
String |
STANDART_FORMAT_SHOT
[filed]时间格式常量 = "yyyy-MM-dd" | ||
String |
UNIT_DAY
[filed]时间单位常量天 = "d" | ||
String |
UNIT_HOUR
[filed]时间单位常量小时 = "h" | ||
String |
UNIT_MINUTE
[filed]时间单位常量分钟 = "n" | ||
String |
UNIT_MONTH
[filed]时间单位常量月 = "m" | ||
String |
UNIT_QUARTER
[filed]时间单位常量度 = "q" | ||
String |
UNIT_SECOND
[filed]时间单位常量秒 = "s" | ||
String |
UNIT_WEEK
[filed]时间单位常量周 = "w" | ||
String |
UNIT_YEAR
[filed]时间单位常量 年 = "y" |
Static Methods Top
Number | between (Date start, Date end) | |
Date | decrease (Date datetime, Integer num, String interval) | |
Number | diff (Date start, Date end, String interval) | |
Date | fromString (String str, String format) | |
Date | getFirstDay (Date date) | |
Date | getLastDay (Date date) | |
Date | getServerDatetime () | |
Boolean | isLeapYear (Date date) | |
Date | now () | |
String | toString (Date dateTime, String formatStr) |
Constructor details
Top
public
Date
()
常用的日期操作
常用的日期操作
Static Properties & Enumerations Detail Top
static
public
String
DEFAULT_FORMAT
[filed]时间格式常量 = "yyyy/MM/dd hh:mm:ss"
static
public
String
DEFAULT_FORMAT1
[filed]时间格式常量 = "yyyy-MM-dd hh:mm:ss"
static
public
String
DEFAULT_FORMAT_SHOT
[filed]时间格式常量 = "yyyy/MM/dd"
static
public
String
STANDART_FORMAT
[filed]时间格式常量 = "yyyy-MM-ddThh:mm:ss.fffZ"
static
public
String
STANDART_FORMAT_SHOT
[filed]时间格式常量 = "yyyy-MM-dd"
static
public
String
UNIT_DAY
[filed]时间单位常量天 = "d"
static
public
String
UNIT_HOUR
[filed]时间单位常量小时 = "h"
static
public
String
UNIT_MINUTE
[filed]时间单位常量分钟 = "n"
static
public
String
UNIT_MONTH
[filed]时间单位常量月 = "m"
static
public
String
UNIT_QUARTER
[filed]时间单位常量度 = "q"
static
public
String
UNIT_SECOND
[filed]时间单位常量秒 = "s"
static
public
String
UNIT_WEEK
[filed]时间单位常量周 = "w"
static
public
String
UNIT_YEAR
[filed]时间单位常量 年 = "y"
Static Methods Detail Top
static
public
Number
between
(Date start, Date end)
计算两个日期相差几天,和diff很相似,返回永远是正整数
static
public
Date
decrease
(Date datetime, Integer num, String interval)
根据日期的规则,为给定的日期减去指定的时间量
static
public
Number
diff
(Date start, Date end, String interval)
计算两个日期的差
static
public
Date
fromString
(String str, String format)
按照给定的日期格式,把字符串转换成日期对象
static
public
Date
getFirstDay
(Date date)
返回月第一天
static
public
Date
getLastDay
(Date date)
返回月最后天
static
public
Date
getServerDatetime
()
获取服务端时间
static
public
Boolean
isLeapYear
(Date date)
判断日期是否是闰年
static
public
Date
now
()
返回当前时间
static
public
String
toString
(Date dateTime, String formatStr)
按照给定的日期格式,把日期对象转换成字符串