Overall, this file is quite a mess. Note, however, that other applications, besides just GnuCash, use this file. In particular, GnoTime (gttr.sourcefore.net) uses this file, and this file is formally a part of QOF (qof.sourceforge.net).
An important note about time-keeping: The general goal of any program that works with numeric time values SHOULD BE to always stores and use UNIVERSAL TIME internally. Universal time is the 'one true time' that is independent of one's location on planet Earth. It is measured in seconds from midnight January 1, 1970 in localtime-Grenwich (GMT). If one wants to display the local time, then the display-print routine should make all final tweaks to print the local time. The local time *must not* be kept as a numeric value anywhere in the program. If one wants to parse a user's input string as if it were local time, then the output of the parse routine MUST BE universal time. A sane program must never ever store (to file or db) a time that is not Universal Time. Break these rules, and you will rue the day...
Copyright (C) 1998-2001,2003 Linas Vepstas <linas@linas.org>
Files | |
file | gnc-date.h |
Date and Time handling routines. | |
Defines | |
#define | MAX_DATE_LENGTH 31 |
#define | QOF_UTC_DATE_FORMAT "%Y-%m-%dT%H:%M:%SZ" |
UTC date format string. | |
#define | DATE_FORMAT_FIRST QOF_DATE_FORMAT_US |
#define | DATE_FORMAT_LAST QOF_DATE_FORMAT_LOCALE |
#define | qof_date_format_get_format qof_date_text_format_get_string |
Enumerations | |
enum | QofDateFormat { QOF_DATE_FORMAT_US, QOF_DATE_FORMAT_UK, QOF_DATE_FORMAT_CE, QOF_DATE_FORMAT_ISO, QOF_DATE_FORMAT_UTC, QOF_DATE_FORMAT_LOCALE, QOF_DATE_FORMAT_CUSTOM } |
enum | GNCDateMonthFormat { GNCDATE_MONTH_NUMBER, GNCDATE_MONTH_ABBREV, GNCDATE_MONTH_NAME } |
|
The maximum length of a string created by the date printers Definition at line 73 of file gnc-date.h. |
|
Definition at line 104 of file gnc-date.h. |
|
UTC date format string. Timezone independent, date and time inclusive, as used in the QSF backend. The T and Z characters are from xsd:dateTime format in coordinated universal time, UTC. You can reproduce the string from the GNU/Linux command line using the date utility: date -u +Y-m-dTH:M:SZ = 2004-12-12T23:39:11Z The datestring must be timezone independent and include all specified fields. Remember to use gmtime() NOT localtime()! Definition at line 85 of file gnc-date.h. |
|
This is how to format the month, as a number, an abbreviated string, or the full name. Definition at line 110 of file gnc-date.h. 00110 { 00111 GNCDATE_MONTH_NUMBER, 00112 GNCDATE_MONTH_ABBREV, 00113 GNCDATE_MONTH_NAME 00114 } GNCDateMonthFormat;
|
|
Enum for determining a date format
Definition at line 88 of file gnc-date.h. 00089 { 00090 QOF_DATE_FORMAT_US, 00091 QOF_DATE_FORMAT_UK, 00092 QOF_DATE_FORMAT_CE, 00093 QOF_DATE_FORMAT_ISO, 00094 QOF_DATE_FORMAT_UTC, 00095 QOF_DATE_FORMAT_LOCALE, 00096 QOF_DATE_FORMAT_CUSTOM 00097 } QofDateFormat;
|