hi, try to use formatdatetime function, the help follows:
FormatDateTime Function Language Reference
Version 2
See Also
Description
Returns an expression formatted as a date or time.
Syntax
FormatDateTime(Date[, NamedFormat])
The FormatDateTime function syntax has these parts:
PartDescription
DateRequired. Date expression to be formatted.
NamedFormatOptional. Numeric value that indicates the date/time format used.
If omitted, vbGeneralDate is used.
Settings
The NamedFormat argument has the following settings:
ConstantValueDescription
vbGeneralDate0Display a date and/or time. If there is a date part, display
it as a short date. If there is a time part, display it as a long time. If
present, both parts are displayed.
vbLongDate1Display a date using the long date format specified in your
computer's regional settings.
vbShortDate2Display a date using the short date format specified in your
computer's regional settings.
vbLongTime3Display a time using the time format specified in your computer's
regional settings.
vbShortTime4Display a time using the 24-hour format (hh:mm).
Remarks
The following example uses the FormatDateTime function to format the
expression as a long date and assign it to MyDateTime:
Function GetCurrentDate
' FormatDateTime formats Date in long date.
GetCurrentDate = FormatDateTime(Date, 1)
End Function
bye,
--
««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
"Thomas Scheiderich" <tf*@deltanet.com> escreveu na mensagem
news:40**************@deltanet.com...
I have the following page as test.aspx:
************************************************** *
<html>
<head>
<title>Hello and Welcome Page</title>
</head>
<body>
<center>
<%
Dim CurrentDate As String
CurrentDate = Today
%>
The current date is <%=CurrentDate %>.<br>
</center>
</body>
</html>
************************************************** *
If I have CurrentDate as String, like I do here, I get the following
page displayed:
The current date is 2/14/2004.
But if I take out the As String and have only "Dim CurrentDate", I get
the following result:
The current date is 2/14/2004 12:00:00 AM.
Why do I get the time for the Variant and not for the string?
Tom.