Retrieving Short Date from DateTimePicker

ahgao2
03-11-2003, 08:05 PM
Hi, how do one retrieve the short date from DateTimePicker? I tried DTPicker1.Value and it returns the Long Date and Time. All I want in the format is 03/12/2003 or 12/03/2003

But I can't seem to get this date format that I want. :(

Thanks in advance!

Spike
03-11-2003, 10:34 PM
Look at the FormatDateTime() function.

ahgao2
03-12-2003, 01:14 AM
I did set the format to dtpShortDate but when I type DTPicker1.Value
I capture the short date and time. The only problem is I don't want to include the time. Is there anyway to retrieve the date that's all? :(

Flyguy
03-12-2003, 02:36 AM
The datepicker control returns a Date value. A date value consists of two parts, the day & time part.
The format you specify for the dtPicker is for display only, not for the return value.
To format the returned value to a date string use the Format() function.
eg:

MsgBox Format(DTPicker1.Value, "dd/mm/yyyy")

ahgao2
03-12-2003, 03:42 AM
Thanks a million Flyguy, now my program is working smoothly... :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum