Time Interval wrong calculation
Hello. I've set the code to calculate the time interval between a dropoff and a pickup. The formula works but for some reason it adds 1 extra hour to the correct calculation..
Can anyone help?
Thanks!
16 replies
-
Have the dropoff and checkout times been recorded in the same time zone, including the DST status?
-
yes i recorded them both. Does the system somwhow change the time zone?! have no idea of the DST? How do I verify these 2 elements?
-
When saving a Date or a Date/Time, Ninox records the epoch as a number of milliseconds since January 1, 1970, 00:00 UTC, and keeps notice of the current time zone (in iOS, not sure in other environments). When computing the difference between two epochs belonging to different time zones, or to the "Summer time" and the "Winter time" in the same place, the result can be somewhat unexpected.
To verify the time zone associated with a Date and/or Time value, use the "format" function: format(variableorfield, "Z").
-
Ok. I set both the records, and in the same time zones.
The problem i belive is that both Checkout Date and Dropoff Date are "Date/Time" fields and the result Storage Duration has to be in hours... how can i solve this?
-
The point is I need to calculate the time interval between 2 Date/Time Field. Do I have to use the Time Interval field? If yes how since the Time Interval has no formula field? I tryed modifing the formula from the table as “Time interval” = “Checkout Date” - “DropOff Date” but no results appear... I get a Yes or No..
-
It depends on the result you need: days rounded, complete days, commenced days...
In general terms: compute the difference between number() of each value, divide by 86400000 (number of milliseconds in a day), and then apply round(), floor() or ceil().
Example: floor((number(end)-number(begin))/86400000)
-
i would need to count the time interval in hours
-
hours and minutes..
-
Could you provide an example showing the values of two Date / Time and their incorrect difference?
-
or even just rounded up to closest hour is ok
-
do you want an example of my first inital option format(“Checkout Date” - “Dropoff Date”, “HH:mm”) ?
-
-
example
-
-
system doesn“t upload images?!
-
If you cannot upload the image, you could just copy and paste the values of the two Date / Time fields involved, and mention the expected result and actual results.
Content aside
- 4 yrs agoLast active
- 16Replies
- 1250Views