KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Obtaining the name of a day as a string
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: February 21, 2003

Versions: 6.7 and 6.8

Here is a simple method that will take a date value as a parameter and return the day as a string value.

C_TEXT($0)
C_DATE($1)
C_LONGINT($viDay)
$viDay:=Day number($1)
Case of
 : ($viDay=1)
 $0:="Sunday"
 : ($viDay=2)
 $0:="Monday"
 : ($viDay=3)
 $0:="Tuesday"
 : ($viDay=4)
 $0:="Wednesday"
 : ($viDay=5)
 $0:="Thursday"
 : ($viDay=6)
 $0:="Friday"
 : ($viDay=7)
 $0:="Saturday"
End case