Convert Timestamp (Expression Function)

Purpose

The Convert Timestamp function (CONVERT_TIMESTAMP) converts a numeric Unix timestamp into a string that using the formatting provided.

Parameters

The Convert Timestamp function has three parameters, two of which is required:

Timestamp

Allowed Inputs: field value or a number representing a Unix timestamp.

There are several sources of Unix timestamps available. For example the stored value of a date or date time field is a Unix timestamp. Also When using the advanced interface the output of the date or date time expression function is a Unix timestamp.

Format

Allowed Inputs: field value or a text string

The format string should contain all the parts of the output including punctuation. The acceptable format parts are YEAR_4_DIGIT, YEAR_2_DIGIT, WEEK_OF_THE_YEAR, WX_STORED_VALUE, TIMEZONE, TIMESTAMP, SECOND, MONTH_WITH_LEADING_ZERO, MONTH_NAME_ABBREVIATED, MONTH_NAME, MONTH, MINUTE, HOUR_WITH_LEADING_ZERO, HOUR_24_WITH_LEADING_ZERO, HOUR_24, HOUR, DAY_OF_THE_YEAR, DAY_OF_THE_WEEK_NUMBER, DAY_OF_THE_WEEK_ABREVIATED, DAY_OF_THE_WEEK, DAY_OF_THE_MONTH_WITH_LEADING_ZERO, DAY_OF_THE_MONTH_SUFFIX, DAY_OF_THE_MONTH, AMPM_UPPERCASE, AMPM_LOWERCASE, and DAY_OF_THE_WEEK_ABBREVIATED.

Timezone

Allowed Inputs: field value or a text string

The third optional parameter of the Days in Month function is a string that represents the timezone. Either use the query builder to choose a field that contains the value or use type a value to enter a number. The value should be based on the tz (timezone) database used by Linux and other Unix system in the form “Area/Location” e.g. “America/New_York”. If no value is provided then the current user's timezone is used.

Output

The output of the Convert Timestamp function is string representing the timestamp based on the provided formatting.

Example

For example CONVERT_TIMESTAMP(1349126584,'MONTH_WITH_LEADING_ZERO/DAY_OF_THE_MONTH/YEAR_4_DIGIT HOUR_24:MINUTE:SECOND','America/New_York') would result in “10/1/2012 17:23:04”.

expression function - convert timestamp.txt · Last modified: 2016/09/14 18:19 (external edit)
Copyright WorkXpress, 2024