Date and Time formatting

Gnumeric supports a wide variety of date and time formatting.

These formats can be used to convert an existing time into a new more readable format, or dates can be entered in these formats and Gnumeric will automatically convert them to a serial number with the proper cell format. See the Section called Dates and Numbers in the chapter called Entering data for more information.

In Example 3 'd' is a day, 'm' is a month, 'y' is a year, 'h' is an hour, and 's' is a second. The default set of formats is locale specific. Gnumeric attempts to guess whether the locale puts months before days or vice versa.

Example 3. Date and Time Formatting.


Time
    Format				Sample

    General				36068.755
    m/d/yy		d/m/yy		9/30/98 	(30/9/98)
    m/d/yyyy		d/m/yyyy	9/30/1998 	(30/9/1998)
    d-mmm-yy		mmm-d-yy	30-Sep-98	(Sep-30-98)
    d-mmm-yyyy		mmm-d-yyyy	30-Sep-1998	(Sep-30-9198)
    d-mmm		mmm-d		30-Sep		(Sep-30)
    d-mm		mm-d		30-09		(09-30)
    mmm/d		d/mmm		Sep/30		(30/Sep)
    mm/d		d/mm		09/30		(30/09)
    mm/dd/yy		dd/mm/yy	09/30/98	(30/09/98)
    mm/dd/yyyy		dd/mm/yyyy	09/30/1998	(30/09/1998)
    mmm/dd/yy		dd/mmm/yy	Sep/30/98	(30/Sep/98)
    mmm/dd/yyyy		dd/mmm/yyyy	Sep/30/1998	(30/Sep/1998)
    mmm/ddd/yy		ddd/mmm/yy	Sep/Wed/98	(Wed/Sep/98)
    mmm/ddd/yyyy	ddd/mmm/yyyy	Sep/Wed/1998	(Wed/Sep/1998)
    mm/ddd/yy		ddd/mm/yy	09/Wed/98	(Wed/09/98)
    mm/ddd/yyyy		ddd/mm/yyyy	09/Wed/1998	(Wed/09/1998)
    mmm-yy				Sep-98
    mmm-yyyy				Sep-1998
    mmmm-yy				September-98
    mmmm-yyyy				September-1998
    d/m/yy h:mm		m/d/yy h:mm	9/30/98 18:07	(30/9/98 187:07)
    d/m/yyyy h:mm	m/d/yyyy h:mm	9/30/1998 18:07	(30/9/1998 187:07)
    yyyy/mm/d				1998/09/30
    yyyy/mmm/d				1998/Sep/30
    yyyy/mm/dd				1998/09/30
    yyyy/mmm/dd				1998/Sep/30
    yyyy-mm-d				1998-09-30
    yyyy-mmm-d				1998-Sep-30
    yyyy-mm-dd				1998-09-30
    yyyy-mmm-dd				1998-Sep-30
    yy
    yyyy

Time
    Format				Sample

    General				36068.755
    h:mm AM/PM				6:07 PM
    h:mm:ss AM/PM			6:07:12 PM
    h:mm				18:07
    h:mm:ss				18:07:12
    m/d/yy h:mm		(d/m/yy h:mm)	9/30/98 18:07	(30/9/98 18:07)
    mm:ss				07:12
    [h]:mm:ss				865650:07:12
    [h]:mm				865650:07
    [mm]:ss				51939007:12
    [ss]				3116340432