DLT job failed to parse timestamp string with T and Z.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 05:26 AM
Hi I am struggling with converting a timestamp string with T and Z to a timestamp column in my DLT job. here is the relevent code snippet:
trans_rules={'timestamp_value', '''to_timestamp(timstamp_str, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")'''}
In my DLT function, I have the following:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 08:56 AM
Hi @Thomas_Zhang , Good Day!
Can you give it a try with the below code format and check if it helps you to set the timezone with Z :
=======================
date_format( to_timestamp(`createdon`, 'yyyy-MM-dd\'T\'HH:mm:ss.SSSSSSSX'), 'yyyy-MM-dd\'T\'HH:mm:ss.SSSSSSSX' )
=======================
Please let me know if this helps and leave a like if this information is useful, followups are appreciated.
Kudos
Ayushi