Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Converting to different date format.....

Reply
Thread Tools

Converting to different date format.....

 
 
Gary Smith
Guest
Posts: n/a
 
      02-14-2004
How to convert date into different formats in ASP.Net ?
Thanks,
Gary


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-14-2004
Hi,

for display purposes you can use string formatting.

DateTime dt=DateTime.Now;
string dtDisplay=dt.ToString("dd.MM.yyyy"); //would produce 14.02.2004

See the documentation for String formatting. Here are the blocks use can use
to build custom formatting patterns:
http://msdn.microsoft.com/library/de...classtopic.asp

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


"Gary Smith" <(E-Mail Removed)> wrote in message
news:%23P$(E-Mail Removed)...
How to convert date into different formats in ASP.Net ?
Thanks,
Gary



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting java.util.Date to java.sql.Date mail4sushovan@gmail.com Java 5 05-04-2011 02:59 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments