Counting number of hours from two different date time

Hi, I recently facing some issue with the expression below:

TOTALHOURS([TimeStamp Out]-[TimeStamp In])

Below as the sample data:
TimeStamp Out : 20/10/2021 19:04
TimeStamp In: 20/10/2021 07:20
Result I got from the expression: 454,091.07

The returnd total hours should be 11 ++ hours?

What have been set wrong with my expression?

0 6 133
6 REPLIES 6

Aurelien
Google Developer Expert
Google Developer Expert

Hi @aijac1314

Your expression looks correct to me.
Can you share a screenshot of your table structure ?

Steve
Platinum 4
Platinum 4

Internally, AppSheet represents dates in US format: MM/DD/YYYY; you appear to be using non-US format: DD/MM/YYYY. That could be a problem. Make sure your spreadsheet columnโ€™s cell format is Date time, that your spreadsheetโ€™s locale is set properly, and that the appโ€™s table locale is set correctly.

Hi Steve, thanks you for the reply.

FYI, I have check the setting, below as the locale setting:

  1. Google Sheet - Locale Setting is English UK and the column which storing date time (TimeStamp In & TimeStamp Out) is set to dd/mm/yyyy HH:mm:ss
  2. Appsheetโ€™s data source is added as locale English UK too

This problem (wrong calculation of the total hour) is randomly happened. Sometime value returned correctly, but sometime not.

I wonder, does the clientโ€™s device also required to set the language as EN UK?

Yes, the clientโ€™s deviceโ€™s locale will affect how dates are displayed to the user, and how dates input by the user are interpreted.

I just confirmed with userโ€™s device, their locale also set as EN UK.

What went wrong ya.

Iโ€™m afraid I donโ€™t know what the problem is. I encourage you to engage Supportโ€“someone there can look at your app configuration to try to find the problem.

https://www.appsheet.com/Support/Contact

Top Labels in this Space