DateTime conversion in dotnet

Posted by Amrendra_Cs under ASP.NET on 2/1/2015 | Points: 10 | Views : 675 | Status : [Member] | Replies : 2
I have date time in standard format as MM/dd/yy HH/mm/as and I have to change it in MM:dd:yy:HH:mm:ss in c# due to client requirement how to change the standard format in the given required format plz help.




Responses

Posted by: kgovindarao523-21772 on: 2/3/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,
DateTime dateTime=DateTime.Now;
string dt=dateTime.ToString(" MM:dd:yy:HH:mm:ss",CultureInfo.InvariantCulture)

Thank you,
Govind

Amrendra_Cs, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 2/3/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
try this

string dateTime=DateTime.Now.ToString("MM:dd:yy:HH:mm:ss");

Mark as Answer if its helpful to you

Amrendra_Cs, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response