Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

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)

1 Accepted Solution

Avatar

Correct answer by
Level 3

The field name should not be quoted.

 

I would also try, just in case

 

date(trim(field_name), 'yyyyMMdd')

 

 

View solution in original post

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

Correct answer by
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