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

Alteryx Designer Desktop Discussions

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

Converting Military Time Integer DataType to Time Datatype and then Add/Substract 45 mins

xaabz
7 - Meteor

I have a time field in the integer datatype in HHMM. I want to convert into Time format HH: MM and then I need to add and subtract 45 min from 2 different columns. Can someone help me with that?


So I want to subtract 45 mins from 15:40 pm so my new time should be 14:55 pm similarly, I need to add 45 minutes in 2035 so my new time should be 2120 pm

zuhaibaliraja_0-1682948438874.png

 

 

18 REPLIES 18
cjaneczko
13 - Pulsar

Verify that the data source is in a string format. Use a selection tool if its not. Then bring in a DateTime tool and use HHmm as the custom format. From there you should be able to do any time related calculations needed with a formula tool.

 

cjaneczko_0-1682949506178.png

 

binuacs
21 - Polaris

@xaabz One way of doing this

binuacs_0-1682949646464.png

 

xaabz
7 - Meteor

Still the same issue. Missing records and when I try to add and subtract then only Null values show up

zuhaibaliraja_0-1682951448528.png

 

zuhaibaliraja_1-1682951466914.png

 

xaabz
7 - Meteor

Still incorrect. What I am missing here?

zuhaibaliraja_0-1682951982229.png

 

binuacs
21 - Polaris

@xaabz Can you provide your sample data?

xaabz
7 - Meteor

Please see the attached

cjaneczko
13 - Pulsar

As for the issue with the 2400, you are probably better off changing any instance of 2400 to 0000. It seems to work fine if you convert them all over. 

 

cjaneczko_0-1682952948344.png

cjaneczko_2-1682953166535.png

 

 

cjaneczko_1-1682953106641.png

 

 

xaabz
7 - Meteor

I need to add 45 minutes in ARR time and substract 45 minutes from DEPRT TIME

xaabz
7 - Meteor

What about the other time slots? See the attached pic

zuhaibaliraja_0-1682953250532.png

 

Labels
Top Solution Authors