WINDEV, WEBDEV AND WINDEV MOBILEONLINE HELPVersion: 1516171819202122232425
• Default characteristics of the weeks
• Characteristics of the weeks according to the ISO 8601 standard
WINDEV
WEBDEV
WINDEV Mobile
Others
WeekToDate (Function)
In french: SemaineVersDate
Returns the date of the Monday for the specified week and year.
Example
dFirstMonday is Date

// First Monday of year 2010: returns 20091228
dFirstMonday = WeekToDate(1, 2010)
// The week number complies with the iso8601 standard: returns 20091228
dFirstMonday = WeekToDate(1, 2010, iso8601)

// Monday of week 52 for year 2008: returns 20081229
dFirstMonday = WeekToDate(52, 2008)
// The week number complies with the iso8601 standard: returns 20081222
dFirstMonday = WeekToDate(52, 2008, iso8601)
Syntax
<Result> = WeekToDate(<Week Number> , <Year> [, <Type of Week>])
<Result>: Character string or Date variable
Date corresponding to the Monday for the specified week and year.
<Week Number>: Integer
Number of the week for which the date of Monday is sought. This parameter is included between 0 and 53. If this number complies with the ISO 8601 standard, <Type of Week> must correspond to the iso8601 constant.
<Year>: Integer
Year that will be used for the calculation.
<Type of Week>: Optional integer constant
Type of the week number:
 iso8601 The week number passed in parameter complies with the ISO 8601 standard.
Remarks

Default characteristics of the weeks

A weeks starts on a Monday and ends on a Sunday.
For the first days of the year:
• If the first day of the year is a Friday, Saturday or Sunday, the week number will be 0. The week #1 will correspond to the first Monday of the year.
• If the first day of the year is a Monday, Tuesday, Wednesday or Thursday, the week number will be 1.
• The days found between the Sunday of the 52nd week and January 1st are part of week 53.

Characteristics of the weeks according to the ISO 8601 standard

A weeks starts on a Monday and ends on a Sunday.
For the first days of the year:
• The week #1 is the week that contains the first thursday of the year.
• The week #1 is the first week that contains most of its days (at least 4 days) in the year. It systematically contains the 4th of January. If systematically contains the first working day of the year, considering that the 1st of January, the Saturdays and the Sundays are non-working days. It is the one whose Monday is nearest to the New Year's Day. It starts between the 29th of December and the 4th of January.
• The last week of the year (52 or 53) is the week that contains the last Thursday of the year. It is the last one to have most of its days (at least 4) in the year and it systematically contains the 28th of December. It is the one whose Sunday is nearest to the 31st of December. It ends between the 28th of December and the 3rd of January.
• There is no week zero (the week #1 of a year immediately follows the last week of the previous year).
• The last days of week #1 can eventually be included at the end of December of the previous year. Similarly, the firs days of the last week (52 or 53) of a year can be included at the beginning of the next year. A year always contains 52 or 53 weeks.
Component : wd250std.dll
Minimum version required
• Version 18