IBM SC41-5210-04 manual Query for iSeries timestamp, Format Name Abbreviation Time Format Example

Models: SC41-5210-04

1 294
Download 294 pages 6.42 Kb
Page 80
Image 80

Valid formats for times are listed in Table 2. Each format is identified by name and includes an associated abbreviation (for use by the CHAR function) and an example of its use.

Table 2. Formats for Representations of Time Data Types

Format Name

Abbreviation

Time Format

Example

 

 

 

 

International Standards Organization

ISO

hh.mm.ss

13.30.05

 

 

 

 

IBM USA Standard

USA

hh:mm am or pm

1:30 pm

 

 

 

 

IBM European Standard

EUR

hh.mm.ss

13.30.05

 

 

 

 

Japanese Industrial Standard

JIS

hh:mm:ss

13:30:05

Christian era

 

 

 

 

 

 

 

OS/400 format

-

HMS

13:30:05

 

 

 

 

Note: Time separators can be either a period (.), slash (/), comma (,), dash (-), or a blank space. Use the CHGJOB command to change the OS/400 date or time format separators.

In the USA time format, the hour must not be greater than 12 and cannot be 0 except for the special case of 00:00 AM. Using the International Standards Organization (ISO) format of the 24-hour clock, the correspondence between the USA format and the 24-hour clock is as follows:

USA Format

24 Hour-Clock

12:01 am through 12:59 am 00.01.00 through 00.59.00

01:00 am through 11:59 am 01.00.00 through 11.59.00

12:00 pm (noon) through 11:59 pm 12.00.00 through 23.59.00

12:00 am (midnight) 24.00.00

00:00 am (midnight) 00.00.00

The system always uses 00.00.00. Only the user can enter 24.00.00.

Query for iSeries timestamp

A timestamp expression is a seven-part value (year, month, day, hour, minute, second, and microsecond) that designates a date and time as previously defined. The time part includes a fractional specification of microseconds.

A timestamp data type starts with a digit and has a length of at least 16 characters. The complete representation of a timestamp has the form yyyy-mm-dd-hh.mm.ss.nnnnnn. Trailing blanks can be included. Leading zeros can be omitted from the month, day, and hour part of the timestamp. Trailing zeros can be truncated or omitted entirely from microseconds. You do not need to specify microseconds. A timestamp of yyy-mm-dd-hh.mm.ssis acceptable. If you choose to omit any digit of the microseconds portion, an implicit specification of 0 is assumed. Thus, 1990-3-2-8.30.00.10is equivalent to 1990-03-02-08.30.00.100000.

A timestamp expression with a time of 24.00.00.000000 can be accepted.

68Query for iSeries Use V5R2

Page 80
Image 80
IBM SC41-5210-04 manual Query for iSeries timestamp, Format Name Abbreviation Time Format Example