Results 1 to 2 of 2

Thread: [RESOLVED] Date Formats

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Resolved [RESOLVED] Date Formats

    Hey,

    While using the following code i need to convert a full date into the 2 digit Month code and 4 digit year.

    <%#DataBinder.Eval(Container.DataItem, "PublicationDate" ,"{0:d})%>

    Anyone know what to 2 format codes are?

    Pino

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Date Formats

    MSDN has all the information you need regarding standard and custom date format strings.

    http://social.msdn.microsoft.com/Sea...20strings&ac=3

    A two-digit month is MM and a four-digit year is yyyy. Put the two together in whatever combination you like, e.g. "MM/yyyy".
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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