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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aniket Narvankar
566
2.1k
602.6k
C Sahrp Date Time Functions
Sep 28 2018 7:10 AM
I want current system date in c sharp in this format,
28-SEP-2018,so I write the following code
string Day = Convert.ToString(DateTime.Now.Day);
string Year = Convert.ToString(DateTime.Now.Year);
string month = DateTime.Now.ToString("MMM").ToUpper();
string date = Day + "-" + month + "-" + Year;
It is giving me date in required format.Is there any other way this could be done in C Sharp? Before this I used this code
string currentDate = DateTime.Now.ToString("dd-MM-yyyy");
but it give me output as 24-08-2018
Reply
Answers (
6
)
Web Service and jquery ajax
How to Merge highlighted Rows in one Row