469,612 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Date Convert

In my C# Webapplication..
I enter the date in a textbox using popup Calender in the format
MM/dd/yyyy..
when i retrieve date from Sql server for updating using datarow to fill the
textbox the date format dd/MM/yyyy hh-mm-ss i want to convert it back to the
original format & ommit the time..

How can i convert this back so i void the exception if user didn't change
date in the update form??
Any help plz

Nov 16 '05 #1
1 4529
Hi,

You can convert a DateTime to string as desired using DateTime.ToString() ,
like this:
DateTime.Today.ToString( "dd/MM/yy", DateTimeFormatInfo.InvariantInfo );

In a similar way you can use DateTime.Parse or DateTime.ParseExact
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Islam Elkhayat" <is******@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
In my C# Webapplication..
I enter the date in a textbox using popup Calender in the format
MM/dd/yyyy..
when i retrieve date from Sql server for updating using datarow to fill
the textbox the date format dd/MM/yyyy hh-mm-ss i want to convert it back
to the original format & ommit the time..

How can i convert this back so i void the exception if user didn't change
date in the update form??
Any help plz

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Simon Brooke | last post: by
4 posts views Thread by Russell | last post: by
4 posts views Thread by Richard Hollenbeck | last post: by
1 post views Thread by Jama | last post: by
1 post views Thread by Scott Berry | last post: by
2 posts views Thread by Franck | last post: by
8 posts views Thread by John Wildes | last post: by
4 posts views Thread by blini | last post: by
9 posts views Thread by Alok yadav | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.