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

Year – PB Docs 125 – PowerBuilder Library

Year – PB Docs 125

Year PowerScript function

Description

Determines the year of a date value.

Syntax

Argument

Description

date

The date from which you want the year

Return Values

Integer. Returns an integer whose value
is a 4-digit year adapted from the year portion of date if
it succeeds and 1900 if an error occurs. If date is null, Year returns
null.

When you convert a string that has a two-digit year to a date,
then PowerBuilder chooses the century, as follows. If the year is
between 00 to 49, PowerBuilder assumes 20 as the first two digits;
if it is between 50 and 99, PowerBuilder assumes 19.

Usage

PowerBuilder handles years from 1000 to 3000 inclusive.

If your data includes date before 1950, such as birth dates,
always specify a 4–digit year so that Year and
other PowerBuilder functions, such as Sort, interpret
the date as intended.

note.png Windows settings

To make sure you get correct return values for the year, you
must verify that yyyy is the Short Date Style for year in the Regional
Settings of the user’s Control Panel. Your program can
check this with the RegistryGet function.

If the setting is not correct, you can ask the user to change
it manually or have the application change it (by calling the RegistrySet function).
The user may need to reboot after the setting is changed.

Examples

This statement returns 2005:

See Also

  • Day

  • Month

  • Year method for DataWindows
    in the DataWindow Reference or online Help


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