# Number of Days calculator / Tool

## How to use this tool

- Enter “Begin” and “End” dates, and the “Number of days & Elapsed time” will be automatically calculated (End - Begin).
- Enter the “Number of days & Elapsed time”, and the “End” date will be automatically calculated (Begin + Number of days).
- The number of days is calculated as “one day after crossing the date” (Not 24 hours).

## UNIX time (POSIX time)

UNIX time is the time representation used internally by computers. It is expressed in seconds, but is sometimes treated in milliseconds.

- Represents the date and time using the number of seconds elapsed since the Unix epoch.
- The Unix Epoch is January 1, 1970 00:00:00 UTC.
- Because leap seconds are adjusted, it does not represent true elapsed seconds like GPS time.

### Year 2038 problem

This is a problem that may cause problems on some computers after 03:14:07 UTC on Jan 19, 2038.

This date is 2147483647 seconds after the UNIX epoch, which is the maximum value for a 32-bit signed integer. Therefore, if UNIX time is treated as an int type, it may overflow to 2038 and malfunction.

Countermeasure 1: Use a 64-bit signed integer (long). In this case, it can be used until about 300 billion years AD. Since the earth should be gone by then, the measurement of time has changed and there will be no problem.

Measure 2: If for some reason 64-bit signed integers cannot be used, 32-bit unsigned integers can be used. In this case, it can be used until February 7, 2106, 6:28:15. Since the human race may be extinct but the earth will continue to exist, we would like to use 64-bit if possible.