DayName
PowerScript function
Description
Determines the day of the week in a date value and returns the
weekday’s name.
Syntax
|
1 |
DayName ( date ) |
|
Argument |
Description |
|---|---|
|
date |
A date value for which you want the name of the day |
Return value
String.
Returns a string whose value is the weekday (Sunday, Monday, and so
on) of date. If date is null, DayName returns null.
Usage
DayName returns a name in the language of the runtime files
available on the machine where the application is run. If you have
installed localized runtime files in the development environment or on a
user’s machine, then on that machine the name returned by DayName is in
the language of the localized files.
For information about localized runtime files, which are available
in French, German, Italian, Spanish, Dutch, Danish, Norwegian, and
Swedish, see the section called “Localizing
the product” in Application Techniques.
Examples
These statements evaluate the date literal 2003-07-04 and set
day_name to Sunday:
|
1 2 |
string day_name day_name = DayName(2003-07-04) |
These statements check to be sure the date in sle_date is valid, and
if so set day_name to the day in sle_date:
|
1 2 3 4 5 6 7 8 9 |
string day_name IF IsDate(sle_date.Text) THEN day_name = DayName(Date(sle_date.Text)) ELSE MessageBox("Error", & "This date is invalid: " & + sle_date.Text) END IF |
See also
DayName method for DataWindows in the section called “DayName” in DataWindow Reference.