Solved

Date format

Posted on 2006-06-23
3
246 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

763 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