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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:30:45+00:00 2026-06-18T02:30:45+00:00

I have been looking through a bunch of different posts on here and on

  • 0

I have been looking through a bunch of different posts on here and on other sites for adding two dates together, but for some reason everyone wants to use ‘Now’

I would like to know how to add two different dates together when neither of which are now!

I have tried a few things but I am getting casting errors. Also worth noting I am setting it to the value of a dateTime picker on my page.

MaxDate.Value = MinDate.Value + TimeSpan.FromDays(1)
'does not work 
MaxDate.Value = Now + TimeSpan.FromDays(1)
'does work!

If it is not obvious, I have two date pickers on my page and when a radio button is clicked I want to set the ‘End date’ (maxdate.value) to whatever the ‘Start date’ (mindate.value) is, and add one day to it.

Thanks for the help!

  • 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-18T02:30:46+00:00Added an answer on June 18, 2026 at 2:30 am

    Just do this:

    MaxDate.Value = MidDate.Value.AddDays(1)
    

    You don’t need create a TimeSpan object for that because the Date type has built-in methods for doing incrementation by day, month, year, minute, etc.

    The AddDays method does not alter the original date, it just returns a new Date object with the offset value.

    By the way, if you want to subtract a day, there is no MinusDays method, just do x.AddDays(-1).

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

Sidebar

Related Questions

I have a pretty specific request. I have been looking through some other posts,
I have been looking through ths hashlib documentation but haven't found anything talking about
I have been looking through the questions asked on StackOverflow, but there are so
I have been looking through quite a few posts on StackOverflow and on the
I have been looking through the archives but can't find a solution that works,
i have been looking through the different questions as to how to remove spaces
I have been looking through so many questions exactly like this, but I have
I have been searching other stackoverflow questions and also looking through the android developer
I have been looking through the source code for the Flash-based Google TV example
I have been looking through code for the last 3 days, and the original

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.