Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DatePicker control

Status
Not open for further replies.

nicsin

Programmer
Jul 31, 2003
743
0
0
GB
Hi,

I have a datepicker control on a form and although I use
Code:
lstStartDate.Format = dtpCustom
lstStartDate.CustomFormat = "ddd, dd mmm yyyy"
lstStartDate.MaxDate = Date
when the app runs I get
Code:
Tue, 20 00 2004
. I have used other formats but:

m -> 0
mm -> 00
mmm -> 00
mmmm -> 00

Am I doing something wrong?
 
Well, I figured it out. It needs capital M as m is for minutes in the time format... [bomb]
 
Now I'm confused;)

Normaly 'n' is used for minutes as 'm' is already occupied by months. 'm' for month in numerical value (1 to 12) and M for month in alpha-numerical value (MMM - Jan to Dec and MMMM - January to December).

But you say 'm' gave you zero, which obviously is no month. Anyone else out there that can clarify this for me?
 
Quoting from MSDN:

m The one- or two-digit minute.
mm The two-digit minute. Single digit values are preceded by a zero.
M The one- or two-digit month number.
MM The two-digit month number. Single digit values are preceded by a zero.
MMM The three-character month abbreviation.
MMMM The full month name.

Mind you this is only valid for DTPicker control. The
Code:
format
function is different.
 
The format function is the one I'm used too. Didn't realise they would differ for the DatePicker.

Thanks.
 
Hi Nicsin,

You Really solved my Problem in using DTPicker. Thanks a Lot man.

Actually i didn't realise the Difference in using the Month format ( m - for minute and M - Month ).

Thanks a lot.
U solved my Mistery.

Muraliambt.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top