toolStripStatusLabel3.Text = (DateTime.Now.ToString());

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I get the value of DateTime to show two characters when it is inthe AM?

What I get in PM = 10/31/07 12:34:22 PM
What I get in AM = 10/31/07 2:34:22 AM

I need: 10/31/07 02:34:22 AM
To make my comparisons easier.

Or better yet, I want to start someting after a certain date.time and end
when another date/time is met. Any ideas how to do this wihtout complicated
string comparisons?
 
CMartin,

Why not take the string and convert to a DateTime instance using the
Parse (or TryParse, if you are unsure of the format) method? You would have
a much easier time comparing the DateTime instances then.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top