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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:45:33+00:00 2026-05-28T04:45:33+00:00

I am updating a scheduling application with ability to repeat appointment dates into the

  • 0

I am updating a scheduling application with ability to repeat appointment dates into the future.

The appointment future appointment time is figured out by finding the amount of minutes between the original appointment start time and end time. So, for the instance the appointment is 120 mins long. In the below code, a book time is a period of time in which appointments can be made. So, the booktime and the appointments in it are getting copied. This is one iteration of appointment copying.

Calendar beginCalendar = Calendar.getInstance();
beginCalendar.setTime(newBookTime.getStartDate());
beginCalendar.add(Calendar.MINUTE, bookTimeDiffMinutes);

newAppointment.setStartDate(beginCalendar.getTime());
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(newAppointment.getStartDate());
endCalendar.add(Calendar.MINUTE, appointmentDiffMinutes);
newAppointment.setStopDate(endCalendar.getTime());

The issue is that on the daylight savings day where CST turns into CDT … if the start time of the appointment is say 11pm on the CST day and then end time on the CDT day say 2am … my appointment ends an hour later or earlier (depending if they clocks are turning back or forward). This is because when I add X mins for the appointment … there is really say 1 less hour that day, because we skip an hour.

So, when I print the dates I can see on the DST day that the time zone changes from CST to CDT:

The book time should be from 20:00-6:00

[STDOUT] The book time start date:Sat Mar 07 20:00:00 CST 2015
[STDOUT] The book time stop date:Sun Mar 08 07:00:00 CDT 2015

whereas on non-daylight savings change day we see:

[STDOUT] The book time start date:Sun Mar 08 20:00:00 CDT 2015
[STDOUT] The book time stop date:Mon Mar 09 06:00:00 CDT 2015

I want to know how I can compensate for this and ensure my appointment and booktime are the correct length on the day that the timezone changes from CST to CDT. If I had a smart way of detecting the change I could add or subtract 60 mins.

Looking for input.

  • 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-28T04:45:34+00:00Added an answer on May 28, 2026 at 4:45 am

    It appears that the goal is to have an appointment of the same duration, regardless of whether the appointment occurs during daylight or standard time, or happens to straddle a time change. Given that, then your code works just fine, the output is reflecting the fact that it’s printing with changed offsets: a 10 hour appointment that started at 20:00:00 CST the night before DST takes effect should end at 07:00:00 CDT the next day, since the time zone will have “sprung forward” an hour.

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

Sidebar

Related Questions

While updating my UI code (C# in a .NET 4.0 application), I ran into
When updating my checked out directory with TortoiseSVN, some subfolders are listed as Skipped
I'm updating some old AWStats config files to filter out some specific IP ranges.
When updating my app into GAE by using the following command: python appcfg.py update
While updating for loops to for-each loops in our application, I came across a
After updating from 3.0.1 to 3.1.1 my application according the relevant railscast i seem
Is updating a Flex Mobile Application done in the same way an Air application
Updating an old ASP/Access site for a client - I need SQL to add
Updating an old piece of software but in order to maintain backward compatibility I
After updating or creating a record I use url helper to redirect to the

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.