Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
7
Answers
DateTime Conversion Error.
Abdul Amin Khan
7y
250
1
Reply
Dear All,
Anyone please tell how to change format of Date to "dd/MM/yyyy hh:mm:ss" from "MM/dd/yyyy hh:mm:ss".
Here is an issue:
//================
var GetLastDBBackupTime = string.Empty;
GetLastDBBackupTime = Convert.ToDateTime("12/15/2017 15:30:25").ToString("dd/MM/yyyy hh:mm:ss");//Showing error Inputed string was not in Correct format.
Output will be : 15/12/2017 15:30:25
if (Convert.ToDateTime(DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss")).TimeOfDay > Convert.ToDateTime(GetLastDBBackupTime).AddHours(1).TimeOfDay)
CreateBackup();
Please help.
its Urgent
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
ASP.NET MVC Dynamic Report
Get Date only from datetime