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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date format

Status
Not open for further replies.

petergroot

Programmer
Oct 23, 2002
9
0
0
NO
Hi,
I let the user input a date in the calender dirct-x control, but i want to format the date to a long date (f. ex. 10 oktober 2002) but when i use cdate(date), then i get 10.10.2002 as ouput.
Can somebody help me out here?
Thanks in advance, Peter
 
cdate(expression) will convert the 'expression' - usually a string - into a valid VB date object. The default print format for a date is server configurable (via control panel), and for you it is 10.10.2002.

Try the formatDateTime(date, fmt) function, this will display the date parameter with the chosen format - of which there are only about 5 options.

Unlike VB6, which has a really powerful 'format' function, the only other way to format a date (even in JavaScript) is to extract each part of the date (Day then Month then Year) and string together the values. To convert the month to a name you will need an array with the month names.
(Content Management)
 
Yes, that was exactly what i was looking for.
Thanks man!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top