DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Date format dd/MM/yyy but not MM/dd/yyyy

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Date format dd/MM/yyy but not MM/dd/yyyy

    [Originally posted by ASHRAF]

    sir,
    I m using vb.net & SQL SERVER
    I want to store data in dd/MM/yyyy but it's always storing in MM/dd/yyyy.
    pls. help me
    nehal

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Date format dd/MM/yyy but not MM/dd/yyyy

    [Originally posted by Mike Lyons]

    Actually, you don't "store" a date in a particular format - dates and times are stored as numeric values.

    What you need to do is format the date values returned from the server to the format you require. Keep in mind however that you still should submit dates to the server in MM/dd/yyyy format.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Date format dd/MM/yyy but not MM/dd/yyyy

    [Originally posted by Chris Carta]

    try this:

    dtmNow.ToString("dd/MM/yyyy")

    Chris

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Date format dd/MM/yyy but not MM/dd/yyyy

    [Originally posted by Duncan]

    I always find storing dates in SQL works best when you pass the date in 'DD MMM YYYY' format. This insures that the day and month don't get mixed up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center