Solved

How would you modify a C# statement to display the time in military time - "DateTime.Now.ToString("yyyyMMdd.hhmmss");"?

Posted on 2014-01-06
3
409 Views
Last Modified: 2014-01-06
In the following C# statement, how would you modify it so that the hh (hours) are created in military time?

MyGlobals.BASE_FILE_Name = "C." + DateTime.Now.ToString("yyyyMMdd.hhmmss");
0
Comment
Question by:zimmer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 39760550
you can create your own from custom Formats as well
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 39760562
MyGlobals.BASE_FILE_Name = "C." + DateTime.Now.ToString("yyyyMMdd.HH:mm");
0
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 39760574
"yyyyMMdd.HHmmss" - capital H.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question