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

Adding hour to Time

BJSOON
8 - Asteroid

Hi, I am trying to add an hour to Time In. :

 

Time InTime Out
14:37:2023:59:00
01:30:1119:00:50

 

Using the following formula I got this:

1+(tonumber(DateTimeFormat([Gate In],"%H"))
+tonumber(DateTimeFormat([Gate In],"%M"))/60
+tonumber(DateTimeFormat([Gate In],"%S"))/360)

 

New Time In

New Time In
15.6722222222222
2.53055555555556

 

The formula only works with String.  How do I convert this back to Time? Or is there a formula whereby I can simply add 1 hour to the Time In which is Time type.  Thank you. 

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @BJSOON I mocked up a workflow that produces the output you describe you need to use a datetimeadd formula.

 

Time.PNG

BJSOON
8 - Asteroid

Thank you!  This works!  I always have trouble with the date/time formula...

JBO
8 - Asteroid

I get a conversion error when I do this:

DATETIMEADD: "2000-01-01" is not a valid DateTime.

Is that normal? Is there a way to get rid of the conversion error?

Thanks 

Labels