Date Formats
See Also
Within a spreadsheet a number within a variate or factor column can be interpreted as a time value and displayed using a date/time format. GenStat stores date/time values as 8 byte double precision real values where the integer part of the value represents the number of days from a base date, and the fractional component is the time during the day as a fraction of 24 hours (e.g. 0.25 = 6 hours). Using this representation, the time between two dates can simply be calculated by subtraction of the two underlying day numbers. Also this format makes GenStat Year 2000 compliant.

Start Dates from

The base day that all other dates are numbered from.

1/3/1600The nominal starting day for the Gregorian calendar.
1/1/1900The starting day used by spreadsheets such as Excel, Lotus and Quattro.

Format List

A drop down list of a wide range of predefined date and time formats that can be used to display the numeric date/time values. The list includes an item called Custom that can be used to specify custom date format. More options for custom date formats can be found on the Date Format tab within the options. The predefined date formats are listed in the table below.

No.FormatExample
1dd/mm/yy03/08/06
2 dd/mm/yyyy 03/08/2006
3 d/m/yy 3/8/06
4 d/m/yyyy 3/8/2006
5 ddmmyy 030806
6 ddmmyyyy 03082006
7 ddmmmyy 03Aug06
8 ddmmmyyyy 03Aug2006
9 dd-mmm-yy 03-Aug-06
10 dd-mmm-yyyy 03-Aug-2006
11 dmmmyy 3Aug06
12 dmmmyyyy 3Aug2006
13 d-mmm-yy 3-Aug-06
14 d-mmm-yyyy 3-Aug-2006
15 d-mmmm-yy 3-August-06
16 d-mmmm-yyyy 3-August-2006
17 yymmdd 060803
18 yyyymmdd 20060803
19 yy/mm/dd 06/08/03
20 yyyy/mm/dd 2006/08/03
21 mmddyy 080306
22 mmddyyyy 08032006
23 mm/dd/yy 08/03/06
24 mm/dd/yyyy 08/03/2006
25 mmm-dd-yy Aug-03-06
26 mmm-dd-yyyy Aug-03-2006
27 yyyy-mm-dd 2006-08-03
28 weekday, dth mmmm yyyy Monday, 3 of August 2006
29 weekday Monday
30 mmm-yy Aug-06
31 yy 06
32 yyyy 2006
33 dd-mmm-yyyy time 03-Aug-2006 18:55:30.35
34 yyyy-mm-dd time24 (ODBC Std) 2006-08-03 18:55:30
35 dd-mmm-yyyy time12 03-Aug-2006 6:55:30 pm
36 time24 18:55:30
37 time12 6:55:30 pm
38 hours 48:55:30
39 seconds 68538.350
40 Custom Date format (See below)

Custom Date format

Allows you to specify a Custom date format which is constructed by a combination of any text, and placeholders (& + a letter) for various time and date components. You can select one of the more common placeholders by clicking on the > button and selecting the item you want to insert into the text. As an '&' is used to define a placeholder, you must use a double '&' i.e. && if you want an '&' to appear in the text. All the available time/date components are shown in the following table:
&AAM/PM.AM
&aam/pm.am
&CCentury as a 4 digit number2000
&cCentury as a 2 digit number20
&DDay of month 2 digit (i.e. leading 0 for day < 10)07
&dDay of month7
&EElapsed time in seconds to 2 decimal places278.35
&eElapsed time in seconds to 2 decimal places3.45
&HHour in the day with leading zero for hour < 1006
&hHour in the day6
&MMonth number with leading 0 if month < 1008
&mMonth number8
&NMonth name in fullJanuary
&nAbbreviated month nameJan
&OHour in the half day with leading zero for hour < 1004
&oHour in the half day i.e. 1-124
&SSeconds in the minute as two digits03
&sSeconds in the minute3
&T100ths of seconds in the second as two digits02
&t100ths of seconds in the second2
&UMinutes in the hour as two digits09
&uMinutes in the hour9
&WDay of week as a number 1-7; 1 = Monday etc.4
&wDay of weekSunday
&YYear with 4 digits2006
&yYear as two digits06
&&Single & in text&

Note

If a date format using just two digits for the year (i.e. contains yy rather than yyyy) is used to display a year outside the period 19XX - 20XX (where XX is set as a number bewteen 0 and 99 by the Start Dates from option on the Options - Date Format) page, then a full 4 digits for the year will be used automatically.

See Also

Within the command language the date format of a VARIATE or FACTOR can be set using the DREPRESENTATION parameter.