Date: Date and Time Printing, Parsing and Manipulation
[Query Object Framework]


Detailed Description

Utility functions to handle date and time (adjusting, getting the current date, printing the date and time, etc.)

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...

Warning:
HACK ALERT -- the scan and print routines should probably be moved to somewhere else. The engine really isn't involved with things like printing formats. This is needed mostly by the GUI and so on. If a file-io backend needs date handling, it should do it itself, instead of depending on the routines here.
(to be renamed qofdate.h in libqof2.)

Author:
Copyright (C) 1997 Robin D. Clark <rclark@cs.hmc.edu>

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 }


Define Documentation

#define MAX_DATE_LENGTH   31
 

The maximum length of a string created by the date printers

Definition at line 73 of file gnc-date.h.

#define qof_date_format_get_format   qof_date_text_format_get_string
 

Deprecated:
qof_date_format_get_format has been replaced by qof_date_text_format_get_string

Definition at line 104 of file gnc-date.h.

#define QOF_UTC_DATE_FORMAT   "%Y-%m-%dT%H:%M:%SZ"
 

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.


Enumeration Type Documentation

enum GNCDateMonthFormat
 

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 QofDateFormat
 

Enum for determining a date format

Enumerator:
QOF_DATE_FORMAT_US  United states: mm/dd/yyyy
QOF_DATE_FORMAT_UK  Britain: dd/mm/yyyy
QOF_DATE_FORMAT_CE  Continental Europe: dd.mm.yyyy
QOF_DATE_FORMAT_ISO  ISO: yyyy-mm-dd
QOF_DATE_FORMAT_UTC  UTC: 2004-12-12T23:39:11Z
QOF_DATE_FORMAT_LOCALE  Take from locale information
QOF_DATE_FORMAT_CUSTOM  Used by the check printing code

Definition at line 88 of file gnc-date.h.


Generated on Fri May 12 18:00:35 2006 for QOF by  doxygen 1.4.4