This topic is locked

Custom 'View As' set Date Format

6/1/2009 10:55:21 AM
ASPRunnerPro General questions
H
huffharper author

I use the Custom "View As" to set color and alignment on a date. When I use the following code it changes my date format. How do I change the date format to short date in the following code?
if rs("EventType")="Phase" then

strValue = "<font color=LightGrey>" & strValue & "</font>"

end if

Sergey Kornilov admin 6/1/2009

You can use FormatDateTime function for this purpose:

http://www.w3schools.com/VBscript/func_formatdatetime.asp
Example:

if rs("EventType")="Phase" then

strValue = "<font color=LightGrey>" & FormatDateTime(strValue,2) & "</font>"

end if