community
cancel
Showing results for 
Search instead for 
Did you mean: 

Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
New content is available in Academy! You may need to clear your browser cache for an optimal viewing experience

Challenge #10: Date Time Calculations

Meteor

Solution inspired from @DE0413 . Was scratching my head due to the 41 sec difference until I read the comments on the thread.

Meteoroid
 
Atom

Same one tool solution for me as well. Thought there would be a function for this as well.

Asteroid

A similar solution to everyone else.  This is my first challenge completed!

 

Spoiler
Days:  DateTimeDiff([Time_Now],[TIMESTAMP],'days')
Hours:  DateTimeDiff([Time_Now],[TIMESTAMP],'hours')-([days]*24)
Minutes: DateTimeDiff([Time_Now],[TIMESTAMP],'Minutes')-([Hours]*60)-([Days]*1440)
Seconds: DateTimeDiff([Time_Now],[TIMESTAMP],'Seconds')-([Minutes]*60)-([Hours]*3600)-([Days]*86400)
Meteoroid
 
Asteroid

The DateTimeNow in the input and answer aren't the same, which made the checks initially not line up...

Alteryx Partner

Challenge 10 complete

Meteoroid

Due to difference in Input and Output file, I use output file for calculation. Just one formula tool with 4 different formulas

 

Spoiler
Days: DateTimeDiff([Time_Now],[TIMESTAMP], "Days")

Hours: DateTimeDiff([Time_Now],[TIMESTAMP], "Hours") - (DateTimeDiff([Time_Now],[TIMESTAMP], "Days") * 24)

Minutes: (DateTimeDiff([Time_Now],[TIMESTAMP], "Minutes") - (DateTimeDiff([Time_Now],[TIMESTAMP], "Hours") * 60))

Seconds: DateTimeDiff([Time_Now],[TIMESTAMP], "Seconds") - (DateTimeDiff([Time_Now],[TIMESTAMP], "Minutes") * 60)

challenge_10_Solution_Flow.png

 




Asteroid
Thank you for the exercise. To get the same result than the Output I had to add 41 secondes to the Time_Now in the Input. Here is my proposed solution.
Highlighted
Meteor

Hi all,

 

I used a single formula block with the formulas below:

 

Spoiler
Days: DateTimeDiff([Time_Now],[TIMESTAMP],"days")

Hours: DateTimeDiff([Time_Now],[TIMESTAMP],"hours")-24*[Days]

Minutes: DateTimeDiff([Time_Now],[TIMESTAMP],"minutes")-([Hours]*60)-([Days]*24*60)

Seconds: DateTimeDiff([Time_Now],[TIMESTAMP],"seconds")-([Hours]*3600)-([Days]*24*3600)-([Minutes]*60)

WeeklyChallenge10.GIF

 

Take a look.


Regards,

Eren.