Solved

Date format

Posted on 2006-06-23
3
241 Views
Last Modified: 2008-02-01
Hello experts,

How do I format a date in c# to read as follows;-


YYYY-MM-DD-hh.mm.ss.000000


where 000000 is the milliseconds

Many Thanks
0
Comment
Question by:claracruz
  • 3
3 Comments
 
LVL 7

Expert Comment

by:pradeepsudharsan
ID: 16968991
System.DateTime a1=System.DateTime.Now;
Response.Write(a1.ToString("yyy-MM-dd-hh.mm.ss.000000"));

--pradeep
0
 
LVL 7

Expert Comment

by:pradeepsudharsan
ID: 16969029
sorry
use this
System.DateTime a1=System.DateTime.Now;
Response.Write(a1.ToString("yyy-MM-dd-hh.mm.ss.mmmmmm"));

--pradeep
0
 
LVL 7

Accepted Solution

by:
pradeepsudharsan earned 500 total points
ID: 16969074
again sorry
use this
System.DateTime a1=System.DateTime.Now;
Response.Write(a1.ToString("yyy-MM-dd-hh.mm.ss.mmm"));//milli seconds
previous one for micro seconds.
i confused with "000000"

regards
--pradeep
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

23 Experts available now in Live!

Get 1:1 Help Now