The Date Data Type

The Date Data Type

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

The Date Data Type

DATE indicates that a value consists of eight digits representing a date in the form YYYYMMDD. For example, 19990821 is August 21, 1999.

Note: If you are using Zim in conjunction with a third-party SQL database engine, the format of dates can differ from that described here. In such cases, your code must avoid making any assumptions about the format of date fields.

Dates and numbers can be freely interchanged. When a number is converted to a date, the number is assumed to adhere to the YYYYMMDD format, so that dividing the number by 10,000 (for example) yields the year. You can subtract one date from another to find the number of days between them, or you can add or subtract a number of days to or from a date to generate another date (i.e., date arithmetic).

The software provides a number of functions to manipulate DATE values. These functions ($year, $ monthname, $ addmonths, $weekday, etc) are described in the Language Reference book of this online help.

Date Data Type Characteristics

Data TypeDecimalsValid RangeStorage Occupied
DATENoneJanuary 1, 0001 to December 31, 9999Eight bytes

See Also

About Conditional Expressions

Conversion Between Data Types

Data Types and Storage of Values

Data Types and the Use of Database Indexes

How To Use Data Types

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish