Week Function

Purpose

Returns an Integer specifying a whole number between 1 and 52, inclusive, representing the week of the year.

Syntax

Week(date)

date:Date exp

Description

The function Week() returns the week of a Date.

Example

OpenW 1

Local z As Date

z = HmsToTime(110000, 20, 4000)

Print z, Week(z)

Print Now, Week(Now)

Print Date, " ", Week(Date)

Print "12/12/1912", " ", Week(#12.12.1912#)

Print FileDateTime("c:\windows\notepad.exe"), Week(FileDateTime("c:\windows\notepad.exe"))

Remarks

If the date of the last day of the year (or two days in a leap year) is put into this function, the value 1 is returned rather than 53.

See Also

CDate(), Date, Date$, DateAdd(), DateDiff(), DatePart(), DateSerial(), DateTime$(), DateToDmy, DateToDmyHms, DateValue(), Day(), DayNo(), DmyHmsToDate(), DmyToDate(), HmsToTime(), Hour(), IsDate(), Minute(), Month(), Now, Now$(), TimeSerial(), TimeToHms, TimeValue(), Second(), Week(), WeekDay(), Year()

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}