Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 7. Working with Times and Dates > Finding the Week of the Year

Feedback: 0 Comments on this Section

7.11. Finding the Week of the Year

The definition of “week number” is not absolute and fixed. Various businesses, coalitions, government agencies, and standards bodies have differing concepts of what it means. This stems, of course, from the fact that the year can start on any day of the week; we may or may not want to count partial weeks, and we may start on Sunday or Monday.

We offer only three alternatives in this section. The first two are made available by the Time method strftime. The %U specifier numbers the weeks starting from Sunday, and the %W specifier starts with Monday.


You are currently reading a free preview of this book.

                                                                                                         

Sign up for a
Safari Library subscription
to access Rough Cuts.

  

Subscribe Now