Date/Time data

Date/Time data display is region specific, in other words, the data is displayed according to local standards for date and time display. The following are the data types included in Date/Time data:

  • Date: This contains an integer number, which is interpreted as a date ranging from January 1, 1754 to December 31, 9999. A 0D (numeral zero, letter D) represents an undefined date (stored as a SQL Server DateTime field) interpreted as January 1, 1753. According to the Developer and IT Pro Help section, NAV 2017 supports a date of 1/1/0000 (presumably as a special case for backward compatibility but not supported by SQL Server).

A Date constant can be written as a letter D preceded by either six digits in the format MMDDYY or eight digits as MMDDYYYY (where M = month, D = day, and Y = year). For example, 011917D or 01192017D both represent January 19, 2017. Later, in DateFormula, we will find D interpreted as day, but here the trailing D is interpreted as the Date (data type) constant. When the year is expressed as YY rather than YYYY, the century portion (in this case, 20) is 20 if the two digit year is from 00 to 29, or 19 if the year is from 30 through 99.

NAV also defines a special date called a Closing Date, which represents the point in time between one day and the next. The purpose of a closing date is to provide a point at the end of a day, after all the real date and time-sensitive activity is recorded - the point when accounting closing entries can be recorded.

Closing entries are recorded, in effect, at the stroke of midnight between two dates. This is the date of closing of accounting books, designed so that one can include or not include, at the user's choice, closing entries in various reports. When sorted by date, the closing date entries will get sorted after all normal entries for a day. For example, the normal date entry for December 31, 2017 would display as 12/31/17 (depending on the date format masking), and the closing date entry would display as C12/31/17. All the C12/31/17 ledger entries would appear after all normal 12/31/17 ledger entries. The following screenshot shows two 2016 closing date entries mixed with normal entries from January through April 2017. (This data is from CRONUS demo. The 2016 Closing entries have an Opening Entry description showing that these were the first entries for the demo data in the respective accounts. This is not a normal set of production data.):

  • Time: This contains an integer number, which is interpreted on a 24-hour clock, in milliseconds plus 1, from 00:00:00 to 23:59:59:999. A 0T (numeral zero, letter T) represents an undefined time and is stored as 1/1/1753 00:00:00.000.
  • DateTime: This represents a combined Date and Time, stored in Coordinated Universal Time (UTC) and always displays the local time (that is, the local time on our system). DateTime fields do not support NAV Closing dates. DateTime is helpful for an application that needs to support multiple time zones simultaneously. DateTime values can range from January 1, 1754 00:00:00.000 to December 31, 9999 23:59:59.999, but dates earlier than January 1, 1754 cannot be entered (don't test with dates late in 9999 as an intended advance to the year 10000 won't work). Assigning a date of 0DT yields an undefined or blank DateTime.
  • Duration: This represents the positive or negative difference between two DateTime values, in milliseconds, stored as a BigInteger. Durations are automatically output in the text format DDD days HH hours MM minutes SS seconds.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.100.42