#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Montreal, Canada
    Posts
    486
    Rep Power
    11

    Converting date ?


    guys I still need your help out there.

    My program read a date in a DataBase, then it add it to a texbox.

    but my problem is that Windows convert that date to fit it's setting.

    exemple :

    the format of the date in my DataBase : 2003-10-07
    the format of windows : jj-mm-aaaa
    so format of my text box will be : 07-10-2003

    cause windows convert it. But I don't want him to convert it like that, I want it to stay normal.

    Cause when I try to record the date in the fomat jj-mm-aaaa in my database (format aaaa-mm-jj) it won't do it cause it's not the same Format of DateTime.

    Damn now how can I fix that in my program ? cause the program is on different station and they don't all use the same style of dates etc... is there a way to fix it ?

    I tryed to do a parse or something ! or something like a toformat of something ! but I just don't see how !

    may be someone already got that problem before ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    109
    Rep Power
    12
    Application.CurrentCulture contains all the culture information and formating that .NET uses for a given workstation. Also useful is the System.Globalization namespace.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Montreal, Canada
    Posts
    486
    Rep Power
    11
    Thank you ! I appreciate it ! I worked another way to solve it cause I didn't know that ! but for the next time it's great !

    I appreciate !

    now do you know how I put a Cell in a Database that is in form of a Date into a Null. Cause when you create a new row, the value is set at Null but then it's got a date in it, but if the date is erase it's need to get back to null. I tryed to use = dbnull.value but you can't convert a date into a Null ! that's kinda weird.

IMN logo majestic logo threadwatch logo seochat tools logo