WeekDay
Result = WeekDay ( Date AS Date ) AS Integer
Retourne le jour de la semaine d'une valeur
Date.
Retourne un entier entre 0 (Dimanche) et 6 (Samedi) qui représente le jour de la semaine pour un argument de date.
Voir
Constantes prédéfinies pour une liste de constantes associée avec les jours de la semaines.
Exemples
PRINT Now; " -> "; WeekDay(Now)
05/16/2002 22:31:30 -> 4
IF WeekDay("6/8/2008") = 0 THEN
PRINT "It is a Sunday"
ELSE
PRINT "It is not a Sunday"
ENDIF
It is a Sunday
DIM DayNames AS String[]
DIM D AS Date
DayNames = Split("Sunday Monday Tuesday Wednesday Thursday Friday Saturday", " ")
D = "6/8/2008"
PRINT "It was a "; DayNames[WeekDay(D)]; " on "; Format$(D, "d mmm,yyyy")
It was a Sunday on 8 Jun,2008
' This example gives the date for the next coming sunday
DIM D AS Date
D = DateAdd(Now, gb.day, 7 - WeekDay(Now))
PRINT "The next Sunday falls on "; Format$(D, "d mmm,yyyy")
Voir aussi