TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Date To Date
Zaid Ansari
Oct 09
2014
Code
1.6
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
DateToDate.rar
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
//Output Data CurrentDate: 01/10/2014 NextMonthDate: 01/11/2014
private
void
Form1_Load(
object
sender, EventArgs e)
{
DateTime Date3 = DateTime.Now;
var Date1 = DateTime.Now;
var Date2 = DateTime.Now;
//Current Month Date 1st
label1.Text =
new
DateTime(Date1.Year, Date1.Month, 1).ToShortDateString();
//Next Month Date 1st
Date3 =
new
DateTime(Date3.Year, Date3.Month, 1);
label2.Text = Date3.AddMonths(1).ToShortDateString();
}
c#
date
add month in current date