Alex Rivera | Logout

How to exclude seconds from DateTime.ToString()

Asked 2010-07-23T07:21:14.527
30

I am using DateTime.Now.ToString() in a windows service and it is giving me output like "7/23/2010 12:35:07 PM " I want to exclude the second part, displaying only up to minute.

So how to exclude seconds from that format...?

Edit
Report

1 Answer

2

please test:

DateTime.Now.ToString("MM/dd/yyyy hh:mm");
answered 2010-07-23T07:26:21.563

Your Answer