Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
how can I convert this value '20210227112912' to 27/02/2021 and split time 11:29 to another column ?
Thanks in advance!
@JJaky you can use Timestamp#() like :
Timestamp(Timestamp#(Field,'YYYYMMDDHHmmss')) to convert your field to timestamp format
Date(Timestamp#(Field,'YYYYMMDDHHmmss'),'DD/MM/YYYY')to extract only date
Time(Timestamp#(Field,'YYYYMMDDHHmmss'),'HH:mm') to extract time
like this script:
load *,Timestamp(Timestamp#(Field,'YYYYMMDDHHmmss')) as NewField,Date(Timestamp#(Field,'YYYYMMDDHHmmss'),'DD/MM/YYYY') as DateField,
Time(Timestamp#(Field,'YYYYMMDDHHmmss'),'HH:mm') as TimeField
inline [
Field
20210227112912
]
the output:
@JJaky you can use Timestamp#() like :
Timestamp(Timestamp#(Field,'YYYYMMDDHHmmss')) to convert your field to timestamp format
Date(Timestamp#(Field,'YYYYMMDDHHmmss'),'DD/MM/YYYY')to extract only date
Time(Timestamp#(Field,'YYYYMMDDHHmmss'),'HH:mm') to extract time
like this script:
load *,Timestamp(Timestamp#(Field,'YYYYMMDDHHmmss')) as NewField,Date(Timestamp#(Field,'YYYYMMDDHHmmss'),'DD/MM/YYYY') as DateField,
Time(Timestamp#(Field,'YYYYMMDDHHmmss'),'HH:mm') as TimeField
inline [
Field
20210227112912
]
the output:
@Taoufiq_Zarra , thanks a lot!