Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Please review the general 1.1.1 Field Type Considerations.

Field Definition Rules

Rules for defining DateTime fields in the repository are:

Length

May be 19 or 21 to 29 in length. Default is 26. Decimals are automatically calculated (if 19, Decimals are 0, otherwise Decimals are Length - 20).

Valid Keyboard Shift

Blanks

Allowed Attributes

AB, ASQN, CS, DUTC, FE, ISO, ND, RA, RL, RLTB, SUTC, TCYC, TCYU and TCYX.

Note
Note: ISO display format must be selected.

Edit Mask

Not allowed.

Default

*SQLNULL. ASQN will be enabled by default.

...

Partition Type

RDMLX Enabled Partition.

Files

DateTime fields may only be used in RDMLX Files. DateTimes may be used as real fields or keys. If used as key fields, take note of the Warning below.

Logical Views

Use of DateTimes as key fields is not recommended.

Virtual Fields

DateTimes may be used with Code Fragment Virtual Fields.

Predetermined Join Fields

Not allowed.

RDML Commands

DateTimes are classified as their own types and are not valid for numeric or alpha command parameters in RDML commands.

Built-In Functions

When used in Built-In Functions, Times are classified as their own types and are not valid for numeric or alpha arguments.

Special Values

*NULL, *HIVAL, *LOVAL, *REMEMBERED_VALUE

Conversion

Date fields may be converted to alpha, signed, packed, string or char. Refer to Field Type Conversions.

...

Tips & Techniques

  • When you first enable your partition for RDMLX, new DateTime fields have SUTC on and DUTC off. This automatically allows multi-time zone applications, with data displayed and entered in local time, but saved in the database in UTC. This may initially be confusing, but in the end, is what most applications need. If you wish your application to run all in UTC or all in local time, simply modify the default field attributes for the DateTime field type.
  • To use a DateTime field, #MyDateTim, as an alpha argument, you simply use #MyDateTim.asString, explicitly stating that you want to use the string representation.
  • To initialize a DateTime field to the current time or to set its default to the current time use the Now intrinsic. This ensures that the field is correctly set to UTC format.

Also See

1.1.11 Date

1.1.12 Time