Expand my Community achievements bar.

How to convert String from source connector to DateTime in Dataset.

Avatar

Level 1

Need to convert the String attribute from source connector(Data landing zone) to Date time in AEP.

Tried to convert using below methods but either it is throwing an error or updating the empty values.

  • dformat
  • zone_date_to_utc
  • make_date_time
  • date
  • set_date_part
  • zone_date_to_zone
  • date_part

Please let us know is there any other process to perform it.

 

Eg: Source data(String-"20220607") Expected output(DateTime)

4 Replies

Avatar

Level 3

Hey,

I tried with the below and got the result, 

date('20220607', 'yyyyMMdd')

 

Screen Shot 2023-07-06 at 10.32.09 AM.png

Avatar

Employee

Hi @birthariyamayank ,

 

Thanks for looking into the issue. Tried the above method still it return null values. PFA screenshot.

 

Thanks,

Vishnu K.conversion.png

Avatar

Level 3

The field name should not be quoted.

 

I would also try, just in case

 

date(trim(field_name), 'yyyyMMdd')

 

 

Avatar

Level 1

Thanks for looking this up further. But still get null values.

 

From Source column name is "Date Time". Tried both the methods nothing worked.

 

e.g: date(trim(Date_Time), 'yyyyMMdd')

       date(trim(DateTime), 'yyyyMMdd')

       Datetime.png