Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
434 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 2000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 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