Results 1 to 4 of 4

Thread: Formatting a Date using the DataBinder.Eval

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Question Formatting a Date using the DataBinder.Eval

    I am getting this result from the DB looking like this using the code below: I want to format it to say Wednesday 5/21/2003 at 12AM. Any clue on how to do this?

    5/21/2003 12:00:00 AM

    Code:
    <%# DataBinder.Eval(Container.DataItem, "AnnouncementCreateDate")%>

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Here you go:

    Code:
    CurrentTimeStamp.Text = DateTime.Now.ToString("MMMM MM/dd/yyyy h:mm:ss tt");
    Just plug in the specified format as the last arg to the Eval() Method

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    Thank you VERY much!

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    No problem..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width