Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

Date

To display the date using VBScript, you use the VBScript date() function.
date()

VBScript Date Code
To display this to the user, you need to output it like you would anything else - for example, using the document.write() method.
document.write(date())

Or even better, you could put the date into a variable first, then output the variable:

localDate = date()
document.write(localDate)

VBScript Date Format
You can use the VBScript FormatDateTime() method to format the date to either a long date format or a short date format.

The FormatDateTime() method accepts two arguments:
The date being formatted, and the required format (indicated by a constant). The formats are specified as follows:
0 - This represents the default date format (as in the previous example)
1 - This represents the long date format (based on the user's regional settings)
2 - This represents the short date format (based on the user's regional settings)

Long Format
To use long date format, you pass the FormatDateTime() an argument of 1.
localDate = FormatDateTime(date(), 1)
document.write(localDate)

Short Format
To use long date format, you pass the FormatDateTime() an argument of 2.
localDate = FormatDateTime(date(), 2)
document.write(localDate)

 
     
   
VBScript Tutorial
 
  Introduction
Introduction
  How to
How to
  Where to
Where to
  Working With Variables
Working With Variables
  Arrays
Arrays
  VBScript Procedures
VBScript Procedures
  Conditional Statements
Conditional Statements
  For Next Loop
For Next Loop
  While Loop
While Loop
  Comments
Comments
  Date
Date
  MsgBox
MsgBox
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Glossary of Search Engine Ranking Term Ebook Glossary of Search Engine Ranking Term
   
Download The Top 10 Ways to Speed Up Your Windows PC Right Now  For Free Ebook The Top 10 Ways to Speed Up Your Windows PC Right Now For Free
   
Download Algorithms in the Real World: Lecture Notes  Ebook Algorithms in the Real World: Lecture Notes
   
Download Golden Adsense Strategy  Ebook Golden Adsense Strategy
   
Download Practical PostgreSQL  Ebook Practical PostgreSQL
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz