Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime asp.net

Status
Not open for further replies.

ludmann

Programmer
Apr 14, 2004
49
GB
Can anyone tell me how to convert DateTime.Now to display in a format 2004-01-20 01:00:00:00

Marika
 
Almost, it now displays 2004-2004-01-20 01:00:00Z

How can I get rid of Z and display 01:00:00:00 instead?
 
lud: See if Jennifer's fine solutin will work: thread855-914441

If it is a simple matter of trimming (Z for Zulu) -
 
I will try, but still missing the last two values,
although if it is always :00 then it is no problem.

 
lud: if it always '00' then you can trim and add, no probelm. Let me know how it works out.
 
You can pass a custom format string to the ToString() method:
"yyyy-mm-dd hh:nn:ss"

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top