Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to change Date Format?

Reply
Thread Tools

How to change Date Format?

 
 
Shapper
Guest
Posts: n/a
 
      05-05-2005
Hello,

I have this code line:
<%# DataBinder.Eval(Container.DataItem, "publication_date") %>

Which displays the date and time as follows:
02-04-2005 0:00:00

How can I change the date format to text?

Thanks,
Miguel

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      05-05-2005
DataBinder.Eval accepts a 3rd parameter which is the string format.

<%# DataBinder.Eval(Container.DataItem, "blah", "{0:dd/mm/YYYY}") %>

Check out:
http://msdn.microsoft.com/library/de...matstrings.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I have this code line:
> <%# DataBinder.Eval(Container.DataItem, "publication_date") %>
>
> Which displays the date and time as follows:
> 02-04-2005 0:00:00
>
> How can I change the date format to text?
>
> Thanks,
> Miguel
>



 
Reply With Quote
 
 
 
 
Shapper
Guest
Posts: n/a
 
      05-05-2005
Thanks,

That was what I was looking for.

Thanks Once Again,
Miguel

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:karl REMOVE @ REMOVE openmymind REMOVEMETOO .
ANDME net:

> DataBinder.Eval accepts a 3rd parameter which is the string format.
>
> <%# DataBinder.Eval(Container.DataItem, "blah", "{0:dd/mm/YYYY}") %>
>
> Check out:
> http://msdn.microsoft.com/library/de...matstrings.asp
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is
> annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
> "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
> news:(E-Mail Removed)...
>
> > Hello,
> >
> > I have this code line:
> > <%# DataBinder.Eval(Container.DataItem, "publication_date") %>
> >
> > Which displays the date and time as follows:
> > 02-04-2005 0:00:00
> >
> > How can I change the date format to text?
> >
> > Thanks,
> > Miguel
> >


 
Reply With Quote
 
anil2082 anil2082 is offline
Junior Member
Join Date: Mar 2008
Posts: 1
 
      03-31-2008
Is it possible to get the MM/dd/yyyy format.
I need to use '/'.
 
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
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP General 11 11-08-2003 11:24 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 Programming 3 11-08-2003 09:07 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