Using date display formats

Applies to

Display formats

Description

A date display format can have two sections. The first section is required. The second section is optional and specifies how to represent NULLs:

date-format;null-format

The following table shows characters that have special meaning in date display formats.

Table 4-3: Special characters in date display formats

Character

Meaning

Example

d

Day number with no leading zero

9

dd

Day number with leading zero if appropriate

09

ddd

Day name abbreviation

Mon

dddd

Day name

Monday

m

Month number with no leading zero

6

mm

Month number with leading zero if appropriate

06

mmm

Month name abbreviation

Jun

mmmm

Month name

June

yy

Two-digit year

97

yyyy

Four-digit year

1997

Colons, slashes, and spaces display as entered in the mask.

Usage

If users specify a two-digit year in a DataWindow object, PowerBuilder assumes the date is the 20th century if the year is greater than or equal to 50. If the year is less than 50, PowerBuilder assumes the 21st century.

For example:

Examples

Example 1

The following table shows how the date Friday, Jan. 30, 2003, displays when different format masks are applied.

Table 4-4: Date format examples

Format

Displays

[red]m/d/yy

1/30/03 (in red)

d-mmm-yy

30-Jan-03

dd-mmmm

30-January

mmm-yy

Jan-03

dddd, mmm d, yyyy

Friday, Jan 30, 2003