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.