Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DateTime.Now.ToShortDateString() and subtract 6 months

Posted on 2009-07-01
4
Medium Priority
?
600 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
4 Comments
 
LVL 22

Assisted Solution

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

Assisted Solution

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

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

Accepted Solution

by:
Rahul Goel ITIL earned 672 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

927 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