PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Default characteristics of the weeks
  • Characteristics of the weeks according to the ISO 8601 standard
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the date of the Monday for the specified week and year.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
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:
iso8601The 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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment