468,512 Members | 1,518 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

DateTimePicker - Format Value

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
5 7192
"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
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
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
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
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.

Similar topics

reply views Thread by E-Cube | last post: by
9 posts views Thread by Ed Crowley | last post: by
3 posts views Thread by Charlie | last post: by
11 posts views Thread by jessy | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.