Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Convert local time to UTC

ARNAB86
Regular Contributor
Regular Contributor

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

4 REPLIES 4

naveenss
All-Star
All-Star

Hi @ARNAB86 you can use CONVERT_TZ method for this. Refer below forum post for reference.

https://forums.saviynt.com/t5/identity-governance/need-to-convert-utc-to-est-time-in-sql-query/m-p/3...

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

NM
Honored Contributor III
Honored Contributor III

Hi @ARNAB86 , try this

select convert_tz(current_date/time,'+00:00','-05:30')


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

dgandhi
All-Star
All-Star
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.

rushikeshvartak
All-Star
All-Star

SELECT
CONVERT_TZ(STR_TO_DATE(u.customproperty53, '%Y-%m-%d %H:%i:%s'), 'America/New_York', 'UTC') AS UTCTIME
FROM
users u


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.