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

Just learning... <%=time()%> not displaying... 1

Status
Not open for further replies.

cottontop

Technical User
Jul 12, 2001
105
0
0
US
Here's the code:

"test.asp"

<%@ language=VBScript %>

<html>
<Head>
<Title>Customer Result Page - Test-01</Title>
</Head>
<Body>
<p>
This is a test... using VBScript<BR>
<p>
The current time is <%=Time()%><BR>
</p>
End of test...<BR>
</Body>
</html>

Here's the result("=" not included:)

========================================
This is a test... using VBScript

The current time is

End of test...
=========================================

The "ASP" is placed on an Intranet server.

As you can see, the title does not display and the time does not display.

According to the lesson, this should be a no brainer!

Is there something I left out???

Thanks
 
What type of server are you posting it on? Is it running IIS?
 
Running of IIS, correct!

I tried <%=(FormatDateTime(Now(),4))%>

Still the same!

Seems as if the server is not recognizing the server commands! (Observation only, not experience!)

Thanks,
 
This worked for me, but it's done with jscript. If this works it means your server commands are working fine:
Code:
<%@ LANGUAGE="JavaScript" %>
<% var today = new Date() %>
<html>
  <Head>
    <Title>Customer Result Page - Test-01</Title>
  </Head>
  <Body>
    <p>
    This is a test... using JScript<BR>
    <p>
    The current time is <%=today%><BR>
   </p>
   End of test...<BR>
   </Body>
</html>

-kaht

banghead.gif
 
Thanks kaht.

It worked using javascript!

Does that point to the server not recognizing VBscript, even though everything is Microsoft?

 
I'm completely VBScript dumb so I'm not sure that the actual cause is that it didn't recognize VBScript. Peronally, I think that if it didn't recognize it, there would have been some kind of error. Since you got a blank string returned (The current time is "") that implies that it ran and compiled, but didn't return the correct value. Then again.... that's just a guess.

-kaht

banghead.gif
 
It seems that I could only get it to work if I run the page using " as oppose to using "\\[servername]\"

Please confirm if I'm figuring this out right.

The reason it works using " is because the server is running the page, where as using "\\[servername]\ , the page is not sent to the server.
 
There is a setting on IIS under server extensions that you can set to recognize one language and not another.

If you want to know how to set that let me know.

cassidy
 
Thanks Cassidy,

I was able to get it to display VBscript time() when I ran it from "
From that, I'm pretty sure that option you mention is set for both Javascript and VBscript, since they both display.

Thanks everyone for the replies!

"I'll be back!!!" (I'm pretty sure of it!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top