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
399 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
  • 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 29

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now