date formatting

  • Thread starter Thread starter Thomas Scheiderich
  • Start date Start date
T

Thomas Scheiderich

I need to format a todays date as:

June 22, 2004

The closest I can come is

Tuesday, June 22, 2004

I need to do this in both asp.net and asp.

I was trying something like:

<%= FormatDateTime(Now(), 2) %>

But can't get the format I want.

Is there a better way?

Thanks,

Tom.
 
M. Zeeshan Mustafa said:
Tom,

Do this:

Format(Now(), "MMMM d, yyyy")

I thought that was how it worked, also. But it won't seem to work. I may
be missing something.

Here is my code:
****************************************************************************
*****
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Intranet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="contour.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"
bordercolor="#000099">
<tr height="100">
<td><table border=1 width="100%" cellspacing="0" cellpadding="0"
summary="Layout Table">
<tr>
<td width="496" height="100" ><img
src="images/Contour_logo_intranet1_1x1.jpg" width="496" height="100"
hspace="0" vspace="0"></td>
<td width="100%"><img src="images/Contour_logo_intranet1_1x2.jpg"
width="100%" height="100" hspace="0" vspace="0"></td>
<td width="129" height="100">
<table height="100" border=0 cellspacing="0" cellpadding="0">
<tr >
<td align="center" height="64"><%= Format(Now(),"MMMM, d, yyyy")
%></td>
</tr>
<tr >
<td height="36" valign="bottom">
<img src="images/Contour_logo_intranet1_1x4.jpg" width="129"
height="36" hspace="0" vspace="0"></td>
</tr>
</table>
</td>
</tr>
</table></td>
</html>
****************************************************************************
******

Here is the error page:

****************************************************************************
******
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be
displayed.

----------------------------------------------------------------------------
----

Please try the following:

Click the Refresh button, or try again later.

Open the localhost home page, and then look for links to the information you
want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

----------------------------------------------------------------------------
----

Technical Information (for support personnel)

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'Format'
/contour/logotest2.asp, line 19


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET
CLR 1.1.4322)
****************************************************************************
******

Thanks,

Tom
 
Tom,

It seems that you're using ASP Classic, however this group
is for ASP.NET. ASP Classic does not support Format function.

ASP Classic questions should go to:
news://news.microsoft.com/microsoft.public.inetserver.asp.general


below is an interesting method you can alter to get functionality of
Format(Now(),"MMMM, d, yyyy"):
http://www.devdex.com/gurus/code/452.asp
 
M. Zeeshan Mustafa said:
Tom,

It seems that you're using ASP Classic, however this group
is for ASP.NET. ASP Classic does not support Format function.

Actually, I am using both and was looking at a way to format it the same
way, easily.
ASP Classic questions should go to:
news://news.microsoft.com/microsoft.public.inetserver.asp.general

Will check there, also.
below is an interesting method you can alter to get functionality of
Format(Now(),"MMMM, d, yyyy"):
http://www.devdex.com/gurus/code/452.asp

I'll check this one out, as well.

Thanks,

Tom
 
ASP Classic* = ASP Classic (in vbscript)


Thomas Scheiderich said:
Actually, I am using both and was looking at a way to format it the same
way, easily.


Will check there, also.


I'll check this one out, as well.

Thanks,

Tom
****************************************************************************
****************************************************************************
****************************************************************************
****************************************************************************
 
Back
Top