Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6701259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:54:46+00:00 2026-05-26T06:54:46+00:00

Delphi Xe, Win 7, System TimeZone UTC+4:0, The first day of week in system

  • 0

Delphi Xe, Win 7, System TimeZone UTC+4:0, The first day of week in system – Monday, Time is synchronised with time.windows.com

In a palette of standard components Delphi Win32 there is component MonthCalendar, at it property WeekNubers=true (display of numbers of weeks), date=now, the first day – Monday.

Shows on 19 number (today) – number of week 43.

I request number through dateutils.WeekOfTheYear(now) = returns 42.

enter image description here

Source (0.5 Mb) http://www.sendspace.com/file/yuz6ko

Judging by an initial code of component MonthCalendar – there like all it is true (even if not to expose the first day of week, it takes value from system parametres).

And in inquiry WeekOfTheYear it is told, that all is considered also standard ISO applied, but numbers do not coincide 🙁

In any way I will not understand, where one week disappears – if to look on a calendar, should be 43 and if to consider, that weeks 53 and the first concerns last year…

By the way WeekOfTheYear on 01.01.2011 too returns 52 though like should return 1…

Why distinctions and where it is correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:54:46+00:00Added an answer on May 26, 2026 at 6:54 am

    Both results are correct, the difference is because the DateUtils.WeekOfTheYear function uses the ISO 8601 standard definition of a week. That is, a week is considered to start on a Monday and end on a Sunday.

    Check this explanation about the Weeks Numbers in the ISO 8601 format.

    If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in
    week 01. If 1 January is on a Friday, Saturday or Sunday, it is in
    week 52 or 53 of the previous year (there is no week 00). 28 December
    is always in the last week of its year.

    Also the Embarcadero online help for the DateUtils.WeekOfTheYear function says

    ….if the first calendar day of the year is a Friday, Saturday, or
    Sunday, then for the first three, two, or one days of the calendar
    year, WeekOfTheYear returns the last week of the previous year.
    Similarly, if the last calendar day of the year is a Monday, Tuesday,
    or Wednesday, then for the last one, two, or three days of the
    calendar year, WeekOfTheYear returns 1 (the first week of the next
    calendar year).

    So due which the 01-01-2011 was Saturday this week is considered the week number 52 of the previous year.

    And that also explains why the week number returned for today (19-10-2011) is 42 instead of 43.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running Delphi 2010 on both a 64 bit windows machine (Win 7),
Using Delphi XE2 on Win 7 64 bit creating a 32 bit app... In
Delphi 2010 Windows 7 - 64 bit. I have an app which is reasonably
im trying to send a Windows message to my Delphi application, but im having
I'm having a hard time with this crazy Vista/Win 7 architecture, it might be
i have an old application (started in delphi 7 in Win XP), now i'm
I have an application written in Delphi 6 and compiled on Windows XP. Usually
Tpanel does not show the top and left border under Delphi XE/Win 7. Why?
How do I read a message of standard Win message box (Info)? Using SendMessage(this.HandleControl,
After upgrading to Windows 7 all seems to work in my Delphi 2007 version

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.