How to format data in Data prep without the time component | Community
Skip to main content
Luca_Lattarini
Level 9
September 13, 2022
Solved

How to format data in Data prep without the time component

  • September 13, 2022
  • 1 reply
  • 1075 views

Hello guys,

I need to store a date without the time component and I am thinking to use the Data prep to do this. Any suggestion on how to remove time component from the date?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @luca_lattarini 

 

How to format the data will depend on the original format of the data.

 

for eg If your original date format looks like this "2022-09-13 10:00:00".

 

Then you can do something like this:

split(myData," ")[0]

The output will be 2022-09-13

 

Refer to this page for all functions:

Data Prep Mapping Functions | Adobe Experience Platform

 

You can also use the date_part function

 

eg: date_part(date("2022-09-13 12:55:12"), "MM")

 

The output will be 09

 

 

1 reply

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
September 13, 2022

Hello @luca_lattarini 

 

How to format the data will depend on the original format of the data.

 

for eg If your original date format looks like this "2022-09-13 10:00:00".

 

Then you can do something like this:

split(myData," ")[0]

The output will be 2022-09-13

 

Refer to this page for all functions:

Data Prep Mapping Functions | Adobe Experience Platform

 

You can also use the date_part function

 

eg: date_part(date("2022-09-13 12:55:12"), "MM")

 

The output will be 09

 

 

Manoj  | https://themartech.pro
Luca_Lattarini
Level 9
September 15, 2022

Hello @_manoj_kumar_ ,

I used format(date("date as string"),''DD-MM-YYYY') because the date was passed as string

Thnaks