473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

date formatting

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.
Nov 18 '05 #1
5 1160
Tom,

Do this:

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

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
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.

Nov 18 '05 #2
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> wrote in message
news:#L**************@TK2MSFTNGP11.phx.gbl...
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>
</tr>
</table</body> </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
--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
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.


Nov 18 '05 #3
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....er.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

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> wrote in message
news:#L**************@TK2MSFTNGP11.phx.gbl...
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>
</tr>
</table
</body> </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

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
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.




Nov 18 '05 #4
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> wrote in message
news:O#**************@TK2MSFTNGP11.phx.gbl...
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....er.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
--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> wrote in message news:#L**************@TK2MSFTNGP11.phx.gbl...
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>
</tr>
</table
</body>

</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

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
> 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.
>
>



Nov 18 '05 #5
ASP Classic* = ASP Classic (in vbscript)
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> wrote in message
news:O#**************@TK2MSFTNGP11.phx.gbl...
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....er.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

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Thomas Scheiderich" <tf*@deltanet.com> wrote in message
news:10*************@corp.supernews.com...
"M. Zeeshan Mustafa" <ze*****@no-spm.please.zeeshan.net> wrote in message news:#L**************@TK2MSFTNGP11.phx.gbl...
> 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>
</tr>
</table
></body>
</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
>
> --
> Hope this helps,
> Zeeshan Mustafa, MCSD
>
>
> "Thomas Scheiderich" <tf*@deltanet.com> wrote in message
> news:10*************@corp.supernews.com...
> > 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.
> >
> >
>
>



Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ed | last post by:
Hi there, My problem is the following: When I assign a custom formatted Date & Time to a Date variable it loses it’s formatting. Ex. 2005-06-07 15:46 now when I assign this to a variable of...
4
by: Paul | last post by:
Hi, Everything went fine getting a short date format out of SQL into my DataGrid with this: <%# DataBinder.Eval(Container.DataItem, "Created", "{0:d}")%> Then I got too fancy in SQL and...
4
by: dhnriverside | last post by:
Hi peeps I have a datepicker control that's providing dates in the format dd/mm/yyyy (UK). I want to convert this to "yyyy-mm-dd" to store as a text field in my database (had lots of problems...
12
by: Rob T | last post by:
I'm storing a date/time into a SQL table of type datetime. I need it to be precise so the value is stored to the 1000th of a second. ie "insert into myTable mydate values ('08/05/2005...
2
by: johndcal | last post by:
Hello All, I have a date value that I pull from a .csv file. After reading the file and storing the values in an array the value of the date could be found in $array, for example....
2
by: David Veeneman | last post by:
How does one format a date column in a GridView control? I had assumed that the DataFormat string would do it, but MSDN only shows numeric formatting codes. Can dates be formatted using that...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
21
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
9
by: Martin | last post by:
I'm retrieving some records from a database. One of the fields contains a date/time. I would like to format it as I send it out to the table in the displayed page. Can some one please tell me...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.