Date/Time

It is very easy to set the date format to one of the common formats, such as dd-mm-yy, mm/dd/yyyy etc. All you need to is change the $custom_strDateFormat and $custom_strDateFormatUI variables in the configuration file:

.
.
.

# Date format. The following characters have special meaning:
# d - day of the month e.g. 1 or 31
# D - zero padded day of the month e,g, 01 or 31
# m - month number 1..12
# M - zero padded month number 01..12
# N - month name (in which case the month names are given by $::custom_strMonths)
# y - 2 digit year e.g. 07
# Y - 4 digit year e.g. 2007
our $custom_strDateFormat = 'M/D/Y';
our $custom_strDateFormatUI = 'MM/DD/YYYY';
our $custom_strMonths = 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec';

.
.
.

The system is delivered with the date format suitable for the UK - i.e. dd-mm-yyyy e.g. Christmas Day 2007 would be '25-12-2007'. Changing it, in most cases, is just a case of changing the above 2 lines in configuration file.

However there are also hook functions that give you complete control over date/time formatting and decoding if you want it. These hooks convert between values stored in 'displayed' date format, and the internal date format (which is fixed in the database as yyyy-mm-dd, the MySQL date format). I.e., you can precisely control the format with which dates are displayed, and the format that users are expected to input them as.

Pedserve also uses DATETIME fields (as opposed to plain DATE fields) in some of its tables - such as the history tables. These are used to timestamp events such as logins, actions taken etc. Hooks are also provided to control the conversion between internal time format (hh:mm:ss) and displayed time format (e.g. 'hh:mm am/pm').

In practice, because of the date format control provided through configuration file, it is rare to need to reimplement the date/time hooks.

Hook Function Description
hookDateTime_ToPrettyDate

Formats a date for presentation to the user. Passed a date in ccyy-mm-dd format, and returns a 'display' date.

hookDateTime_FromPrettyDate

Converts a 'display' date into a ccyy-mm-dd format date.

hookDateTime_MakePrettyInputDateFormatDescriptionText

Returns the text of a description of the date format as the user is expected to enter (e.g. in search forms). E.g this might return 'dd-mm-yyyy' etc.

hookDateTime_MakePrettyOutputDateFormatDescriptionText

Returns the text of a description of 'display' date format in the format we present it to the user (e.g. in search results forms). E.g this might return 'dd-mm-yyyy' etc. Normally this is the same as the input format.

hookDateTime_MakePrettyOutputDateFormatDescriptionText

Formats a time-within-day string for display purposes. Passed a string in hh:mm:ss format.

hookDateTime_FromPrettyTimeWithinDay

Converts a 'display' time-within-day into the internal hh:mm:ss format.

hookDateTime_MakePrettyInputTimeWithinDayFormatDescriptionText

Returns the text of a description of 'display' time-within-day format as the user is expected to enter (e.g. in search forms). E.g. this might return 'hh:mm[:ss]'.

hookDateTime_MakePrettyOutputTimeWithinDayFormatDescriptionText

Returns the text of a description of 'display' time-within-day format in the format Pedserve presents it to the user (e.g. in search results forms).

USEFUL LINKS:
 EULA
 Pedserve Editions
 Sample City
 Consultancy
 Data Preparation
 Installation
 Regular Expressions
 Similarity Searching
 Configuration File
 Setup Script
 Stylesheet
 Database Design
 Hooks
 Date/Time
 User Defined Fields
 User Defined Records
 Display Fields Definitions
 Ordering Fields Definitions
 Highlighting
 Page Layout
 Field Definitions
 Field Formatting
 Shortcut Query Buttons
 Plates
 Command Buttons
 Connecting to the Database
 Warning Footer Message