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 8933909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:39:30+00:00 2026-06-15T09:39:30+00:00

I am making a calendar program. The ‘expand repeating events’ code is giving me

  • 0

I am making a calendar program. The ‘expand repeating events’ code is giving me no end of trouble. I am expanding events by using mktime() to get a ‘pure’ time value, then adding the repeat delta (in this case, 604800 seconds or 7 days) to it. localtime() is then used to get a calendar struct back out.

This happens:

Original event: September 10

{tm_sec = 0, tm_min = 0, tm_hour = 16, tm_mday = 10, tm_mon = 9,
 tm_year = 2012, tm_wday = 4, tm_yday = 283, tm_isdst = 0, 
 tm_gmtoff = -25200, tm_zone = 0x608ff0 "PDT"}

First repetition: September 17

{tm_sec = 0, tm_min = 0, tm_hour = 17, tm_mday = 17, tm_mon = 9,
 tm_year = 2012, tm_wday = 4, tm_yday = 290, tm_isdst = 1, 
 tm_gmtoff = -25200, tm_zone = 0x608ff0 "PDT"}

Second repetition: September 24

{tm_sec = 0, tm_min = 0, tm_hour = 16, tm_mday = 24, tm_mon = 9,
 tm_year = 2012, tm_wday = 4, tm_yday = 297, tm_isdst = 0,
 tm_gmtoff = -25200, tm_zone = 0x608ff0 "PDT"}

Third repetition: September 31?!

{tm_sec = 0, tm_min = 0, tm_hour = 16, tm_mday = 31, tm_mon = 9,
 tm_year = 2012, tm_wday = 4, tm_yday = 304, tm_isdst = 0,
 tm_gmtoff = -25200, tm_zone = 0x608ff0 "PDT"}

Does anyone have any idea what’s going on here? Will I have to fill in for localtime() myself?

  • 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-06-15T09:39:32+00:00Added an answer on June 15, 2026 at 9:39 am

    From the documentation: the members of the struct tm structure are 0-based (as usually in C).

    int    tm_mon   month of year [0,11]
    

    So actually the month numbered 9 is the 10th month, which is October, and it has 31 days.

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

Sidebar

Related Questions

I am making a calendar using the following HTML code: <!DOCTYPE HTML PUBLIC -//W3C//DTD
I am making an hours calendar using MVC's Code First approach. This is the
I am making a view just like the iPhone Calendar ListView. I am using
I'm making a sort of calendar of events app. There are 2 types of
I'm making a back-end function for another area of a program that will add
I have telerik controls on my page. I am making a vacation calendar using
I'm making a calendar From in C# using WinForms. I've put it together using
I'm making a calendar for jquery mobile, I'm using the jquery weekcalendar (jQ wC),
I'm making the same query to get Calendar events two different ways. The odd
I'm making a calendar of events, and the details for the event are on

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.