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

Format date

Status
Not open for further replies.

durug

Technical User
Mar 22, 2002
335
CA
Hi!

Does anybody knows if there is in VBS a function that formats the date like this:

From 4/21/2003 to April 21 2003
There is a function:
FormatDateTime(Date(),1)
but it displays:
Monday April 21 2003
But I don't need the day!
And I don't want to change the regional setting on my computer.

Thanks,
Durug

 
This may not be exactly what you are looking for but it is an easy solution.

<%dim one,two
one = formatDateTime(Date(),1)
two = instr(1,one,&quot;,&quot;)
one = mid(one,two+1)
Response.Write(one)%>

basically all's you are doing is removing the day from the string.

I hope that helps
Roj
 
Thanks for the solution. I was just looking for a built in function not a page designed function. Because I have 150 Date Fields in the page and if I format each field with my function, the performance will decrease comparing with a VBS built in function.

Durug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top