Solved

Date format

Posted on 2006-06-23
3
248 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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