Expression Language
Also available as:
PDF

format

Description: Formats a number as a date/time according to the format specified by the argument. The argument must be a String that is a valid Java SimpleDateFormat format. The Subject is expected to be a Number that represents the number of milliseconds since Midnight GMT on January 1, 1970. The number will be evaluated using the local time zone unless specified in the second optional argument.

Subject Type: Number

Arguments:

  • format : The format to use in the Java SimpleDateFormat syntax

  • time zone : Optional argument that specifies the time zone to use (in the Java TimeZone syntax)

Return Type: String

Examples: If the attribute "time" has the value "1420058163264", then the following Expressions will yield the following results:

Table 1.18. Table 18. format Examples

Expression

Value

${time:format("yyyy/MM/dd HH:mm:ss.SSS'Z'", "GMT")}

2014/12/31 20:36:03.264Z

${time:format("yyyy/MM/dd HH:mm:ss.SSS'Z'", "America/Los_Angeles")}

2014/12/31 12:36:03.264Z

${time:format("yyyy/MM/dd HH:mm:ss.SSS'Z'", "Asia/Tokyo")}

2015/01/01 05:36:03.264Z

${time:format("yyyy/MM/dd", "GMT")}

2014/12/31

${time:format("HH:mm:ss.SSS'Z'", "GMT")}

20:36:03.264Z

${time:format("yyyy", "GMT")}

2014