Remember the date string is just a display version of a
DateTime value. Once
you get into a DateTime structure you can display it any way
you want.
You can use the Parse method
http://msdn2.microsoft.com/en-us/library/syst
em.datetime.parse.aspx,
to load the structure. The simplest overload of the method
uses he current
culture of the application to parse the string. If you want
to use a
different culture or date style you need to use one of the
other
constructors and supply the culture and/or style to use.
and here's some more on parsing....
http://msdn2.microsoft.com/en-us/library/2h3syy57.aspx
Once you've created the DateTime structure, you can display
the value using
it's ToString() method
DateTime EnteredDate = DateTime.Parse(EnteredString);
string FormattedDate =
EnteredDate.ToString("MM-dd-yyyy"); //case
matters,
mm is minutes
On 1/28/07, OwaiZ <owaiz_vaiyani hotmail.com> wrote:
>
> hi
> any know how to convert entered date string from
dd-mm-yyyy to mm-dd-
> yyyy when using update in gridview
> thanks
>
>
>
--
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blog
baby
Microsoft MVP
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:AspNetAnyQuestionIsOk-digest@yahoogroups.com
mailto:AspNetAnyQuestionIsOk-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|