Start Free Trial

Alteryx Designer Desktop Discussions

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

How to Convert String Time to Date Time

Alteryx_Geek
8 - Asteroid

Hello folks,

 

I am trying to convert the below String Time to Time, but not able to succeed. Any help would be greatly appreciated

 

2022-02-17 08:44:27.491250

 

10 REPLIES 10
Luke_C
17 - Castor
17 - Castor

Hi @Alteryx_Geek 

 

Here's 3 ways to convert to datetime: 

  1. Select tool (since the data is already basically in the correct format this works)
  2. DateTime Tool
  3. Date Time parse formula

Luke_C_0-1645108767442.png

 

Alteryx_Geek
8 - Asteroid

Appreciate the quick response Luke. Is it possible to get the "msec" values as well in the output ?

atcodedog05
22 - Nova
22 - Nova

Hi @Alteryx_Geek 

 

Alteryx DateTime format doesnt support milli secs only secs is the last. If you want to display in specific format let me know but it will not be an Alteryx supported time format.

 

Hope this helps : )

Alteryx_Geek
8 - Asteroid

@atcodedog05 - Thanks for the insight. I have a below data in String format, and I want to calculate the time difference Current Row & Row-1

 

2022-02-17 16:17:39.779204
2022-02-17 16:17:39.784663
2022-02-17 16:17:40.028639
2022-02-17 16:17:40.784812
2022-02-17 16:17:40.863132

atcodedog05
22 - Nova
22 - Nova

Hi @Alteryx_Geek 

 

You are looking for the mili seconds to also be considered right?

atcodedog05
22 - Nova
22 - Nova

Hi @Alteryx_Geek 

 

Give this a try. Diff is the output.

 

Workflow:

atcodedog05_0-1645112962539.png

 

Hope this helps : )

 

Alteryx_Geek
8 - Asteroid

Thanks a ton, this looks good. But I dont know I am getting this error when I am placing your workflow in my workflow

 

Alteryx_Geek_0-1645114160561.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @Alteryx_Geek 

 

check whether time2 datatype is set to double if yes run the workflow and you should not face this issue.

 

Hope this helps : )

Alteryx_Geek
8 - Asteroid

Yes, you were right. The type was changed for TIme2 and it worked as expected. Much Appreciated

Labels
Top Solution Authors