Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Convert to Date

SteveFord
7 - Meteor

Hi all,

 

Any ideas to how I can convert the below string to a date, ie. 2021/06/24:

 

Thu Jun 24 2021 13:36:58 GMT+0100 (British Summer Time)

5 REPLIES 5
DawnDuong
13 - Pulsar
13 - Pulsar

(I just realised that i mis-read your question - pls refer to Emil's reply instead)

hi @SteveFord 

There are a couple of ways. - shown in the attached are 2 methods.
Dawn.

Emil_Kos
17 - Castor
17 - Castor

Hi @SteveFord,

 

As the first 4 characters are irrelevant I removed them with a substring formula.

 

After that, I have used date time parse to transform the data into a proper one.

 

Emil_Kos_0-1625062458280.png

 

KarolinaRoza
11 - Bolide

hi @SteveFord ,

 

 

Another possible solution:

- Regex to filter for string "Mon dd yyyy"

- DateTime tool : to convert string to date format.

 

KarolinaRoza_0-1625062738926.png

 

You can choose which suits you the most 🙂

 

Regards,

Karolina

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @SteveFord,

 

You could cut straight to it with a DateTime tool, no need for string calcs or Regex. Just specifying the correct incoming string field format will give you what you're looking for:

 

day Mon dd yyyy hh:mm:ss

 

Input:

JonathanSherman_0-1625064113706.png

 

Output:

JonathanSherman_1-1625064142941.png

 

I've attached my workflow for you to download if needed!

 

Kind regards,

Jonathan

 

 

 

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Or if you're just looking for the Date and not interested in the time part, in your DateTime tool you could simply use:

day Mon dd yyyy

 

JonathanSherman_0-1625064261033.png

 

I've attached an updated workflow for you to download if needed!

 

Kind regards,

Jonathan

 

Labels