Current time "now"

I had my app working to where it was calculating the time difference between “Ontime” and the current time “now”. For some reason the app stopped working properly all of a sudden and I cannot figure out what would have changed. Picture shows how delta time was calculating the difference. Is it my “Now” (current time) variable? TIA!

What do you get as a result for your Delta Time? What’s not working?

My delta time for some reason is not calculating correctly. At the time of the screen shot below, the current time was 11:11 am so my delta time should have been 4 minutes? This was not a problem the last time I used the app so it seems like something changed. Thank you!

Just quickly testing, it seems to be working for me, but can you explain more about your Ontime column and how that is calculated? Does it maybe have the wrong date somewhere?

the Ontime is and has been calculating correctly so the delta seems to be the culprit all of a sudden. The green times are set times from a table.

To the best of my knowledge, I attempted to create the same scenario as yours. These screenshots were taken at approximately 5:05pm.

image

image

image

image

To get anything remotely close to the results you have, I have to change the T time Date/Time to Feb 26th, which is just short of a week ago. I would start there and see what the underlying date is for your T Time column. Since you have a few columns only showing Time instead of Date and Time, I suspect that the underlying date is wrong. Showing only Time doesn’t make it immediately apparent. Double click on the date cells that show only time to see what the true underlying value is.

image

1 Like

Thank you so much. Yes, my T time does show February 27. Why is that? Thanks!

1 Like

All depends on how you fill that date, but at least you know the source of the problem now.

1 Like

the date reflects the day I re-entered the list of times. Is there a way to ignore the date as I’m only interested in the time?

Date type columns always contain a date and a time. That’s just how they work. There is no such thing as a time only type of column. You can format it to only display time, but that is only for display purposes. The underlying date is still there.

Date type columns are very interesting in how they work. They are very flexible as far as the format of the date that can be entered. If you were to enter only a time in a date column, it will usually default to the nearest date, which could be yesterday, today, or tomorrow. With that flexibility, you can also pass in words. If you write the word ‘today’ in a date column, it will interpret it as today’s date. If you wrote ‘today at 11:15am’, it would interpret it as today’s date with a time of 11:15. That may be a method you could use, but I’m not sure off the top of my head if the date will dynamically change each day, or if it becomes static. It’s a bit of a hack, but it’s pretty impressive. I dive deeper into that method with this post.

What I would probably do instead, is create some creative date math that would take the now date, basically subtract the time to get it to midnight, and then add in your selected time. It’s a bit to work out the math, but definitely possible. I think I have done it in the past, or something similar, but I’d have to sit down and work it out. I’m pretty confident that it’s doable. This post is probably where I would start to build out the math.

So to be clear, when you enter a T time, are you doing it through the app, or do you just type it into the data editor? I just want to make sure I understand how the time gets put into that column.

1 Like

very interesting! The T times I just typed into the table. Like I had mentioned, it was working correctly for a couple of weeks and it went south only after I reentered some additional times (on Feb 27). So I’m not sure how or why the date became significant after I re-typed all the times (I couldn’t figure out how to add additional rows so I just retyped all the times).

“Today” is static so that doesn’t work.

Trunc(Now) doesn’t seem to work for me. It always returns the current date and time and not midnight. I was trying to do something like Trunc(Now) + 6 hours. Does this work for you? Thanks!

never mind! Did not dive deeper into your previous attachment! Trunc(now) brings me to current date and time as set by seed date and time so I think it will work! Thanks for your help again!

2 Likes