0

I need formatting of date/time in this format:

set @date1 = Format(Now(),"YYYY-MM-DDThh:mm:ssZ")

Where as its not working and if I give like this - FormatDate(Now(),"YYYY-MM-DDThh:mm:ssZ"), only date is formatting.

Is there any other method where I can format time too?

I need the output format in GMT time i.e. it should be like this - 2018-10-24T06:44:37.000+0000. (yyyy-mm-ddThh:mm:ss.sssZ)

3

2 Answers 2

1

Please note that the 'HH' in the time part need to be in capitals if you want to use 24 hour notations. If lowercase 'hh' is used, SFMC will format the time to a '12 hour clock' hour.

set @date1 = Format("2019-12-16 14:24:56", "yyyy-MM-ddTHH:mm:ssZ") results in: 2019-12-16T14:24:56Z

set @date2 = Format("2019-12-16 14:24:56", "yyyy-MM-ddThh:mm:ssZ") results in: 2019-12-16T02:24:56Z

0

Did a quick test and apparently all that needed to be changed was the capitalization of the 'Y', the 'D' and the 'Z'.

Below worked for me:
set @date1 = Format(Now(),"yyyy-MM-ddThh:mm:ssz", "Date")

Which output:
2018-11-30T08:15:57-6

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .