?
Solved

Date format

Posted on 2011-10-24
3
Medium Priority
?
180 Views
Last Modified: 2012-05-12
in c#, what is the code to get a date out to a string in this format...

mmddyyyy  (all together, no dashes or spaces)

I'm wanting to append this on a variable holding a file name.


Example:

myFile10242011.xls


0
Comment
Question by:carsRST
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 2000 total points
ID: 37018857
Try this code
DateTime time = DateTime.Now;              
string format = "MMddyyyy";    
format = time.ToString(format);

Open in new window


Regards
0
 
LVL 16

Author Closing Comment

by:carsRST
ID: 37018888
Thank you so much!
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 37018917
Welcome
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 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