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/1600 | The nominal starting day for the Gregorian calendar. |
1/1/1900 | The starting day used by spreadsheets such as Excel, Lotus and Quattro. |
Format list
A dropdown 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 Tools | Options menu. The default date format applied to a column is set using the Date Format tab opened from the Tools | Options menu.
The predefined date formats are listed in the table below.
No. | Format | Example |
1 | dd/mm/yy | 03/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) |
The first numbers in the table are the equivalent values of DREPRESENTATION parameter in PRINT.
Custom date format
Lets you specify a Custom date format which is constructed by a combination of any text, and place holders (& + a letter) for various time and date components. You can select one of the more common place holders by clicking on the button and selecting the item you want to insert into the text. As an ‘&& if you want an ‘&’ to appear in the text. All the available time/date components are shown in the following table:
&A | AM/PM. | AM |
&a | am/pm. | am |
&C | Century as a 4 digit number | 2000 |
&c | Century as a 2 digit number | 20 |
&D | Day of month 2 digit (i.e. leading 0 for day < 10) | 07 |
&d | Day of month | 7 |
&E | Elapsed time in seconds to 2 decimal places | 278.35 |
&e | Elapsed time in hours to 2 decimal places | 3.45 |
&H | Hour in the day with leading zero for hour < 10 | 06 |
&h | Hour in the day | 6 |
&M | Month number with leading 0 if month < 10 | 08 |
&m | Month number | 8 |
&N | Month name in full | January |
&n | Abbreviated month name | Jan |
&O | Hour in the half day with leading zero for hour < 10 | 04 |
&o | Hour in the half day i.e. 1-12 | 4 |
&S | Seconds in the minute as two digits | 03 |
&s | Seconds in the minute | 3 |
&T | 100ths of seconds in the second as two digits | 02 |
&t | 100ths of seconds in the second | 2 |
&U | Minutes in the hour as two digits | 09 |
&u | Minutes in the hour | 9 |
&W | Day of week as a number 1-7; 1 = Monday etc. | 4 |
&w | Day of week | Sunday |
&Y | Year with 4 digits | 2006 |
&y | Year as two digits | 06 |
&& | Single & in text | & |
There is only one custom format available for all spreadsheets, so that changing this in one column will change it in all other columns in all other spreadsheets, and if the spreadsheet is sent to another user, the custom date format displayed in a column will be that set up in their options.
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 between 0 and 99 by the Start dates from option on the Tools | Options | Date Format tab) page, then a full 4 digits for the year will be used automatically.
See also
- Options – Date Format
- Fill a Column with Dates or Times
- List of DREPRESENTATION parameter codes for the PRINT directive
Within the command language the date format of a VARIATE or FACTOR can be set using the DREPRESENTATION parameter.