Skip to main content
Skip table of contents

OFFSET_FORMAT_DATE

The OFFSET_FORMAT_DATE function is used to set a timezone offset and then format a date time value.

Usable: Value Fields

Syntax: { OFFSET_FORMAT_DATE(( PARAM_1 PARAM_2 PARAM_3 PARAM_4 )) } }

Parameter

Type

Examples

Description

PARAM_1

JSONPath

$.value

The JSONPath expression representing the date and time that should be formatted.

PARAM_2

string

'+8','-8'

The timezone offset. The offset should be specified in hours and can be positive or negative.

PARAM_3

string

'd', 'D', 'f', 'F', 'g', 'G', 'm', 'o', 'r', 's', 't', 'T', 'u', 'U', 'Y'

The format specifier for the output date string.

PARAM_4

string

'en-US', 'de-DE', 'es-ES', 'fr-FR', etc.

The culture used for formatting the output date string.

Value Field Example

For example, consider the following data source JSON:

CODE
{
  "value": "2020-09-01T22:05:45.488+02:00"
}

To format the value to a date string with an offset of +8, use the OFFSET_FORMAT_DATE function to format the value to a date string

CODE
{ OFFSET_FORMAT_DATE(( $.time '+8' 'g' 'en-AU' )) }

This will result in 2/9/2020 4:05 am

Format and Culture Examples

Format Specifier

Culture

Result

d

de-DE

31.10.2008

d

en-US

10/31/2008

d

es-ES

31/10/2008

D

de-DE

Freitag, 31. Oktober 2008

D

en-US

Friday, October 31, 2008

D

fr-FR

vendredi 31 octobre 2008

f

en-US

Friday, October 31, 2008 5:04 PM

F

en-US

Friday, October 31, 2008 5:04:32 PM

g

en-US

10/31/2008 5:04 PM

G

en-US

10/31/2008 5:04:32 PM

m

en-US

October 31

o

en-US

2008-10-31T17:04:32.0000000

r

en-US

Fri, 31 Oct 2008 17:04:32 GMT

s

en-US

2008-10-31T17:04:32

t

en-US

5:04 PM

T

en-US

5:04:32 PM

u

en-US

2008-10-31 17:04:32Z

U

en-US

Friday, October 31, 2008 9:04:32 AM

Y

en-US

October 2008

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.