View Single Post
Old 07-07-2008   #2 (permalink)
Jan Hyde (VB MVP)


 
 

Re: date time formatting

Andrew <Andrew@xxxxxx>'s wild thoughts
were released on Mon, 7 Jul 2008 01:51:01 -0700 bearing the
following fruit:
Quote:

>hi,
>
>my sp takes datetime in 'yyyyMMdd HH:mm:ss' format.
>
>however my c# datetimepicker takes 'dd/MM/yy HH:mm:ss' format.
>
>how do i convert/parse the datetime value from the datetimepicker to the sp
>datetime format ? I've tried:
>eg.
>IFormatProvider culture = new CultureInfo("en-US", true);
>DateTime dt3 = DateTime.ParseExact("20080722 10:00:00" , "yyyyMMdd
>HH:mm:ss", culture);
>
>No matter what datetime format I pass in, I will always get a "dd/MM/yyyy
>HH:mm:ss" format in return, which is not what I want to get. Is my culture
>wrong ?
>
Store your date in the format you want in a string and pass
that to your sp.
--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde
My System SpecsSystem Spec