The term 'date-arithmetic' refers to determining via code such information as how many days, hours, etc. between two calendar dates, and determining the last day of the month, or whether a date is a weekday or a weekend. Be sure to also include the appropriate programming or database tag.
Many computer languages provide for date arithmetic, including shell, java, and database languages. Most languages store data with a type of date internally as a number of days since a certain date, such as January 1st 1970 for Unix.
Typical Considerations
- Basic calculations such as number of days between two dates, number of months between two dates, etc.
- Scheduling problems often involve how to determine the fifth business day of the month, the last day of the month, the fourth Thursday of the month
- Regional or Client-specific concerns include whether certain days are holidays, etc.
- Week number of the year (ISO: Monday as first day of week, Unix: Sunday as first day of week)