Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can I compute the number of weeks in a year

How can I compute the number of weeks in a year

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SPGV
    wrote on last edited by
    #1

    I think, some years have 52 weeks while some have 53. Is there a way of using CTime/SPan classes to compute this

    C 1 Reply Last reply
    0
    • S SPGV

      I think, some years have 52 weeks while some have 53. Is there a way of using CTime/SPan classes to compute this

      C Offline
      C Offline
      csc
      wrote on last edited by
      #2

      How about do it like that : COleDateTime ct = COleDateTime( 2003, 12, 31, 23, 59, 59 ); int iNumWeeks = atoi( ct.Format( "%U" ) );

      R 1 Reply Last reply
      0
      • C csc

        How about do it like that : COleDateTime ct = COleDateTime( 2003, 12, 31, 23, 59, 59 ); int iNumWeeks = atoi( ct.Format( "%U" ) );

        R Offline
        R Offline
        Rage
        wrote on last edited by
        #3

        Hi ! please use the <pre> HTML tags (see Formatting bar under your sig when writing a message) to format your code instead of bold. It is far more readable. ;) ~RaGE();

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups