Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this format: 01/05/2018 [07:40 PM]
How I can convert this to Date, Year, Month, Day, Hour, Minute.
Thanks
You could purge the square brackets using purgechar() and then use parsing function date#() to make proper timestamp out of it and then extract the components you need like:
Date(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT')) as Date
....
Hour(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT')) as Hour
You can replace the highlighted timestamp string with your field.
You could purge the square brackets using purgechar() and then use parsing function date#() to make proper timestamp out of it and then extract the components you need like:
Date(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT')) as Date
....
Hour(Date#(Purgechar('01/05/2018 [07:40 PM]','[]'), 'DD/MM/YYYY hh:mm TT')) as Hour
You can replace the highlighted timestamp string with your field.