You can translate the question and the replies:

timestamp to date

Hi Team, How to convert timestamp to date ? from: 2022-02-17 09:23:13 to: 2022-02-17 Denodo 7.0 update 20210224 Thanks.
user
17-02-2022 08:45:28 -0500
code

4 Answers

Hi, Starting from Denodo 7.0, the date part will be always displayed as **‘yyyy-MM-dd’** and the time part will be always displayed as “HH:mm:ss.S”. So, if you want to convert the field from timestamp type into date type, then you could use the **FORMATDATE **function. For example, Select formatdate(‘yyyy-MM-dd’,<date-field>) For more information, you could refer to the [FORMATDATE](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/date_processing_functions#formatdate) section of the Virtual DataPort VQL Guide. Hope this helps!
Denodo Team
18-02-2022 06:14:40 -0500
code
Hi Team, Need some more assistance. I have a field of denodo datatype 'timestampz' which is sourced from denodo sp cache content, having a let's say value as '2022-03-23 11:17:07.363+09:30'. I want to convert it to 'utc' time zone. But unable to. I have tried below formulas: formatdate('yyyy-MM-dd HH:mm:ss', lastdate, 'utc') formatdate('yyyy-MM-dd HH:mm:ss', lastdate, 'us_utc_iso') Both formulas return me value as '2022-03-23 11:17:07' Please suggest. Thanks.
user
23-03-2022 07:23:29 -0400
please help.
user
24-03-2022 23:41:36 -0400
Hi, I would like to let you know that starting from **denodo-v70-update-20200310** includes a new function **convert_timezone** which will convert a timestamptz to a specified time zone. You can find the syntax of these functions on the Virtual DataPort Administration tool by navigating to the menu bar “Help” > “Functions Lists”. For Example, you can use the below syntax which will convert the timestamptz with respect to desired timezone: ` convert_timezone(targettimezone, timestamptz) ` Let’s assume the source timezone as “utc” and the second input should be of timestamptz datatype. So, you need to convert the fieldname to timestamptz data type using the [to_timestamptz](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/date_processing_functions#to-timestamptz) function. So, in order to achieve your requirement, you could use the below query: ``` select convert_timezone('utc',to_timestamptz('yyyyMMddHHmmss.SX',<date-field>)) ``` In case you need further assistance and if you have a valid Support Account then you can reach out to Denodo Support by raising a support case on Denodo Support Site and the Support Team will assist you. Hope this helps!
Denodo Team
25-03-2022 01:07:30 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here