DateTime.createTime()

Signature

createTime(int year, int month, int date, int hrs, int min, int sec, String tz)

Domain

action, condition

Description

Create a DateTime object of a particular timezone. Month value is 0-based. 0 for January, 11 for December.

Parameters

NameTypeDescription
yearintThe value of the YEAR time field.
monthintThe value of the MONTH time field. Month value is 0-based. e.g., 0 for January.
dateintThe value of the DATE time field. The day of month value between 1-31.
hourintThe value of the HOUR time field. Hour value between 0-23.
minintThe value of the MINUTE time field. Minute value between 0-59.
secintThe value of the SECOND time field. Second value between 0-59.
tzStringThe Time Zone ID. If null, the default TimeZone will be used.

Returns

TypeDescription
DateTimeThe created DateTime with timezone set to tz.

Cautions

none

Example


DateTime date = DateTime.createTime(2005, 7, 19, 12, 39, 37, "GMT");
String result = DateTime.format(date, "yyyy-MM-dd HH:mm:ss z")

Result is: "2005-08-19 12:39:37 GMT"