Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

CustomFormat – PB Docs 2021 – PowerBuilder Library

CustomFormat – PB Docs 2021

CustomFormat

property for PowerScript controls

Applies to

DatePicker controls

Description

The CustomFormat property specifies a custom format for the display
of the date in a DatePicker control. You must set the Format property to
the enumerated value dtfCustom! for the CustomFormat to take
effect.

The format strings in the following table can be combined to format
the date and time. If you want to include string literals in the
CustomFormat string, enclose them in single quotes to ensure that the
letters they contain are not interpreted as format strings.

Format string

Description

d

The one- or two-digit day.

dd

The two-digit day. Single-digit day values are
preceded by 0.

ddd

The three-character weekday
abbreviation.

dddd

The full weekday name.

h

The one- or two-digit hour in 12-hour
format.

hh

The two-digit hour in 12-hour format. Single-digit
values are preceded by 0.

H

The one- or two-digit hour in 24-hour
format.

HH

The two-digit hour in 24-hour format. Single-digit
values are preceded by 0.

m

The one- or two-digit minute.

mm

The two-digit minute. Single-digit values are
preceded by 0.

M

The one- or two-digit month.

MM

The two-digit month. Single-digit values are preceded
by 0.

MMM

The three-character month
abbreviation.

MMMM

The full month name.

s

The one- or two-digit second.

ss

The two-digit second. Single-digit values are
preceded by 0.

t

The one-letter abbreviation for AM or PM in uppercase
(AM displays as A).

tt

AM or PM in uppercase.

X

A callback field used to query the user for a portion
of the custom format. This format string is not supported in
PowerBuilder.

y

The one-digit year (2007 displays as
“7”).

yy

The two-digit year (2007 displays as
“07”).

yyy or yyyy

The full year (2007 displays as
“2007”).

Usage

In the painter

To set the CustomFormat property:

  1. Select dtfcustom! from the Format drop-down list on the General
    page of the control’s Properties view.

  2. Specify a custom format in the Custom Format field.

This custom format displays the date and time at 8 p.m. on the first
day of 2007 as January 1, 2007 08:00:00 PM:

This custom format displays the same time on the last day of 2006 as
December 31, 2007 20:00:00 PM:

In scripts

The CustomFormat property takes a string value. The following
statements set the Format property to allow a custom format, then set the
custom format to display the full month name, the two-digit date followed
by a comma, and the full year:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x