FAQ
How can we help?
Full Site Search

Why do two date fields with the format yyyy / mm / DD have a decimal point when they are subtracted by a formula?

This situation usually occurs when the user’s browser time zone is in the Daylight Saving Time, assuming that the time in one date field is in daylight saving time (March to October), and the time in the other date field is not (November to February), there will be a decimal point if the two fields are subtracted.

For example: the user’s browser is in the US time zone. A1 and A2 in the form are all date fields in the format yyyy/MM/dd, the value of A1 is 2020/10/31, and the value of A2 is 2020/11/02. Applying the formula "A2-A1" to A3, you will find that A3’s result is "2.0416667" instead of the expected "2". This is because 2020/10/31 is the daylight saving time in the United States whereas 2020/11 /02 is no longer daylight saving time, so there will be a difference of 0.0416667 days (equal to 1 hour). At this time, the formula should be changed to ROUND(A2-A1) to obtain an integer result.

Top of Page

    Start Ragic for Free

    Sign up with Google