You can translate the question and the replies:

Date format

Hello Team, I have a request to expose a date for a client to this formt "yyy-MM-ddT00:00:00.000Z" the OriginalDate is like "2022-02-08T00:00:00" i used the following function but in the result the 'Z' doesn't appear: formatdate('yyyy-MM-dd''T''HH:mm:ss.SSSZ', cast('localdate',OriginalDate)) AS Date, the result is '2022-02-08T00:00:00.000+0100' Any advice? Regards, Mehdi
15-02-2022 04:24:05 -0500

1 Answer

Hi, For your scenario, you can use the formatdate function similar as below, ` formatdate('yyyy-MM-dd''T''HH:mm:ss.SSS''Z''', cast('localdate',OriginalDate)) ` Here, in order to escape the single quote used in the text ‘Z’, you should use another single quote ‘‘Z’’. For more information, you can refer to the Blue note section of the [FORMATDATE]( function. Hope this helps!
Denodo Team
15-02-2022 23:53:54 -0500
You must sign in to add an answer. If you do not have an account, you can register here