Solved

DateTime.Now.ToShortDateString() and subtract 6 months

Posted on 2009-07-01
4
595 Views
Last Modified: 2013-12-17
I am using DateTime.Now.ToShortDateString() to return todays date.

How am i able to use DateTime.Now.ToShortDateString() and subtract 6 months from it?
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 166 total points
ID: 24755534
DateTime.Now.AddMonths(-6).ToShortTimeString();
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 166 total points
ID: 24755540
have you tried:

DateTime.Now.addmonth(-6).ToShortDateString()
0
 
LVL 9

Accepted Solution

by:
Rahul Goel ITIL earned 168 total points
ID: 24755554
Here is the solution
DateTime.Now.AddMonths(-6).ToShortDateString()

Open in new window

0
 

Author Closing Comment

by:Mr_Shaw
ID: 31598812
thanks
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question