Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/18/2024 04:17 AM
Hi Team,
How to convert "STR_TO_DATE(u.customproperty53,'%Y-%m-%d %H:%i:%s') " to UTC time.
customproperty53 value passing as string 2024-07-18 10:20:00
Thanks
Arnab Pal
07/18/2024 06:48 AM - edited 07/18/2024 06:48 AM
Hi @ARNAB86 you can use CONVERT_TZ method for this. Refer below forum post for reference.
07/18/2024 06:56 AM
Hi @ARNAB86 , try this
select convert_tz(current_date/time,'+00:00','-05:30')
07/18/2024 07:01 AM
CAST(FROM_TZ(CAST(DATE_FIELD AS TIMESTAMP), 'UTC') at time zone 'America/New_York' AS Date) as DESIRED_FIELD_NAME
Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.
07/18/2024 07:34 AM
SELECT
CONVERT_TZ(STR_TO_DATE(u.customproperty53, '%Y-%m-%d %H:%i:%s'), 'America/New_York', 'UTC') AS UTCTIME
FROM
users u