You can translate the question and the replies:

Denodo date function conversion

I have a field with data type odf text that returns value in the format : '2021-01-10T07:04:38Z' How can I convert it to locale specific date format so that I can perform date operation on it??
user
23-11-2023 02:20:14 -0500
code

1 Answer

Hi, If I want to convert the data type from text to `locale`, then I would follow the below steps: * Open the Virtual DataPort Administration tool and select the required base view. * Navigate to the **Edit** option in the base view. * In the **View Schema** section, there is a field named ‘field type’. * Select the drop down menu and navigate to the field of type ‘localdate’ and select the ‘DATE’ option as the sub data type from the edit option. * Finally, save the changes to the view to change the data type as expected. Also, there is a predefined function [to_localdate](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/functions/datetime_functions/datetime_functions#to-localdate) in Denodo, which helps to convert the data type of a text value containing a datetime in a specific format. For instance, I would make use of the following syntax to convert the data type of the specified field: ``` select TO_LOCALDATE(‘yyyy-MM-dd’ ,<column_name>) from <Database_name>.<view_name>; ``` For further information, please refer to the [Date and Time functions](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/language_for_defining_and_processing_data_vql/data_types/data_types_for_dates_timestamps_and_intervals) document under the Virtual DataPort VQL Guide section. If you still need further assistance and if you are a valid support user, you can raise a [Support Case](https://support.denodo.com/cases/add), for further assistance from the Support Team. Hope it helps!
Denodo Team
23-11-2023 07:12:00 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here