ASP
  Home arrow ASP arrow Page 3 - What are Active Server Pages?
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

What are Active Server Pages?
By: Sriram K
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 226
    2004-05-24

    Table of Contents:
  • What are Active Server Pages?
  • Displaying the Current Date and Time
  • Example 1
  • Examples 2, 3 and 4
  • Cool Things You Can Do with Date, Time, and Text
  • Differences Between VBScript and JavaScript

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    What are Active Server Pages? - Example 1


    (Page 3 of 6 )

    Example 1

    Suppose you wanted to display today's date as day/month/year instead of month/day/year. To do so, you would use the day, month, and year ASP functions together, by typing:

    <% =day(now) %>/<% =month(now) %>/<% =year(now) %>

    When you view the page, you would see something like this:

    23/1/1997

    Later we'll see how you can change this so only the last two digits of the year are displayed, like this:

    23/1/97

    Weekday and Weekdayname

    To display the day of the week as a number from 1 to 7 in a Web page, type:

    <% =weekday(now) %>

    where you want it to appear. When you view the page in Internet Explorer, you'll see a 1 if today is Sunday, 2 if it's Monday, and so on.

    To display the day of the week by name, type:

    <% =weekdayname(weekday(now)) %>

    where you want it to appear.

    Hour, Minute, and Second

    To display just the hour part of the current time, type:

    <% =hour(now) %>

    where you want it to appear. The hour function is based on a 24-hour clock. When you view the page, you'll see a number between 0 and 23.
    To display just the minutes part of the current time, type:

    <% =minute(now) %>

    where you want it to appear. When you view the page, you'll see a number between 0 and 59.

    To display just the seconds part of the current time, type:

    <% =second(now) %>

    where you want it to appear. When you view the page, you'll see a number between 0 and 59.

    More ASP Articles
    More By Sriram K


     

    ASP ARTICLES

    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application
    - Easy Error Management





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway