By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,205 Members | 977 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,205 IT Pros & Developers. It's quick & easy.

DateTimePicker - Format Value

P: n/a
My system short date format is dd/mm/yy.

The DateTimePicker returns mm/dd/yyyy hh:mm:ss PM.

I need to get this value formated into dd/mm/yyyy regardless of the system
short date format, what do I need to use please.

Regards
Terry
Mar 28 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Terry" <ne*******@whiteHYPHENlightDOTme.ukschrieb:
My system short date format is dd/mm/yy.

The DateTimePicker returns mm/dd/yyyy hh:mm:ss PM.

I need to get this value formated into dd/mm/yyyy regardless of the system
short date format, what do I need to use please.

The DateTimePicker control's 'Value' property returns a 'Date' instance,
which you can format by calling its 'ToString' method and passing
appropriate formatting options to this method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Mar 28 '07 #2

P: n/a
Hi Terry,

Try setting the Format property = Custom and CustomFormat property =
"dd/MM/yyyy"

hth

diego

On Mar 29, 5:32 am, "Terry" <news-g...@whiteHYPHENlightDOTme.uk>
wrote:
My system short date format is dd/mm/yy.

The DateTimePicker returns mm/dd/yyyy hh:mm:ss PM.

I need to get this value formated into dd/mm/yyyy regardless of the system
short date format, what do I need to use please.

Regards
Terry
Mar 29 '07 #3

P: n/a
Thanks Herfield, perfect, just ready to drop right into a textbox.
Regards

Terry
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"Terry" <ne*******@whiteHYPHENlightDOTme.ukschrieb:
>My system short date format is dd/mm/yy.

The DateTimePicker returns mm/dd/yyyy hh:mm:ss PM.

I need to get this value formated into dd/mm/yyyy regardless of the
system short date format, what do I need to use please.


The DateTimePicker control's 'Value' property returns a 'Date' instance,
which you can format by calling its 'ToString' method and passing
appropriate formatting options to this method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Mar 29 '07 #4

P: n/a
Thanks Diego,

This will be useful for changing the displayed value in the control, at the
moment long date is OK. Thanks for the usefull info.
Regards

Terry

"diego" <di******@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Hi Terry,

Try setting the Format property = Custom and CustomFormat property =
"dd/MM/yyyy"

hth

diego

On Mar 29, 5:32 am, "Terry" <news-g...@whiteHYPHENlightDOTme.uk>
wrote:
>My system short date format is dd/mm/yy.

The DateTimePicker returns mm/dd/yyyy hh:mm:ss PM.

I need to get this value formated into dd/mm/yyyy regardless of the
system
short date format, what do I need to use please.

Regards
Terry

Mar 29 '07 #5

P: n/a
Sorry for the name typo, Herfried.
Regards

"Terry" <ne*******@whiteHYPHENlightDOTme.ukwrote in message
news:ut**************@TK2MSFTNGP02.phx.gbl...
Thanks Herfield, perfect, just ready to drop right into a textbox.
Regards

Terry
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>"Terry" <ne*******@whiteHYPHENlightDOTme.ukschrieb:
>>My system short date format is dd/mm/yy.

The DateTimePicker returns mm/dd/yyyy hh:mm:ss PM.

I need to get this value formated into dd/mm/yyyy regardless of the
system short date format, what do I need to use please.


The DateTimePicker control's 'Value' property returns a 'Date' instance,
which you can format by calling its 'ToString' method and passing
appropriate formatting options to this method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Mar 29 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.