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
Dinesh Santhalingam
NA
737
368.7k
Time change format in C#
Sep 1 2017 12:58 AM
I want to get the current datetime in MM/dd/YYYY hh:mm:ss tt format .The system time may in whatever the format.
Using Datetime.Now the time format may found.
String timeformat= DateTime.Now.ToString(
"dd/MM/yyyy HH:mm:ss tt"
);
o/p is : 01/9/2017 10:00:05 AM
But I want to convert this string to datetime variable with change in format.
DateTime timeformat1= Convert.ToDateTime(timeformat);
My o/p will like be : 9/01/2017 10:00:05 AM
Please help me to solve this.
or else I want to get the Datetime in MM/dd/YYYY HH:mm:ss tt format.
Help me to solve this.
Reply
Answers (
7
)
Unable to understand the code
null from Server