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
401 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET HttpWebRequest 12 58
COnsume rest client 6 36
Where can I ask about my ASP.NET MVC project? 6 23
How can my static class become undefined?? 8 21
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

21 Experts available now in Live!

Get 1:1 Help Now