Date/Time Data |
Top Previous Next |
If an import field is to be received as a date or date/time the default format depends on whether you are using the "international" or "U.S." build of dbFile.
The same formats apply for exports, according to whether the build is international or U.S. NOTE :: Imported date fields will also be treated as default format if the separator character is a hyphen instead of a forward slash, viz., dd-mm-yyyy for international, mm-dd-yyyy for U.S. builds. Non-Default Date Formats To correctly interpret or output date or date/time strings other than the default, you can include an attribute dateform=N, where N is a number specifying another supported format. Global Specification of Date Format Using options dateform=N in a control file, or using instead the command-line switch -f N, causes all imported date data to be interpreted or all exported date literals to be written according to the date format corresponding to N. If you specify the date format at this level, it is your responsibility to ensure that all of the date fields in incoming data are presented consistently in the format anticipated by N. If an options dateform=N directive is present in the control file, any usage of the switch -f N in the command-line call will be ignored. Field-level Specification of Date Format If your input or output record specification includes fields of more than one literal format then the dateform=N attribute should NOT be specified globally. The attribute should be supplied in the SQL statement, embedded in curly braces after the SQL identifier of the column it is to qualify, for example, {dateform=N}. (It might be one of a comma-separated list of attribute qualifiers for the field.) For more details about embedded attributes, refer to the topic dbFile Embedded Field Descriptors in the chapter entitled The SQL Statement.
Forcing Hyphen Separators in Output By default, all exported date and date/time data that use month and day separators will use slashes. You can force hyphens to be used in place of slashes, as follows:
NOTE :: It is not possible to generate a record format that has some date formats using slashes and others using hyphens. |