Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Can't seem to convert a text timestamp format 'DD MMM YYYY hh:mm:ss' to a timestamp 'MM/DD/YYYY HH:MM:SS'. The 3 character month 'Jan', etc. does not translate to the equivalent month number? What am I doing wrong. I'm using the timestamp function.
Try like this
Timestamp (Timestamp#(time_field, 'DD MMM YYYY hh:mm:ss'), 'DD/MM/YYYY hh:mm:ss') as new_field,
If it's not working share the same data
Check the definitions of your variable MonthNames.
Your short month names (Jan, Feb etc.) need to correspond to the MonthNames system variable.
Try like this
Timestamp (Timestamp#(time_field, 'DD MMM YYYY hh:mm:ss'), 'DD/MM/YYYY hh:mm:ss') as new_field,
If it's not working share the same data
HI,
Try like below, it will helps you
Script:
Timestamp(Timestamp#(YourFieldName, 'DD MMM YYYY hh:mm:ss'),'MM/DD/YYYY hh:mm:ss') as YourFieldName
Sample: Timestamp(Timestamp#('09 Sep 2020 16:09:54','DD MMM YYYY hh:mm:ss'),'MM/DD/YYYY hh:mm:ss') gives result as "09/09/2020 16:09:54".
Thanks & Regards,
Mayil Vahanan R
Thank you - works beautifully!
Welcome !!