Showing posts with label standardize. Show all posts
Showing posts with label standardize. Show all posts

Friday, February 24, 2012

date field not standardize

my problem is about how to standardize format date while storing data

- > my pc set regional setting as mm/dd/yyyy
-> ms sql server just followed this format (i guess)
->date field using data type datetime


i have web page that required user insert date with format dd/mm/yyyy

after that i'll convert that value to ->mm/dd/yyyy

it seem to be okay at first . but when i try to insert this date value it will start to be suck all my day.

date value -> 05/11/2003 (that mean 05 November 2003)
suppose that data store to table -> 11/05/2003

but this is what happen to my table ->05/11/2003 . so it take 05 as month and 11 as day. but when i try insert more then 10 day it's okay 15/12/2003

sorry if my word not very clear. but i really need help on thisIf you are transferring the date as a string then use yyyymmdd - it is unambiguous (yyyy-mm-dd is not).