VBScript TutorialIntroductionVBScript Editors VBScript Syntax VBScript Variables VBScript Arrays VBScript Date VBScript If Statements VBScript Select Case VBScript While Loop VBScript For Loop VBScript Operators VBScript Functions Summary Got a MySpace Page?Get "www.yourname.com" for your MySpace page. Learn how >>. |
VBScript DateTo display the date using VBScript, you use the VBScript date() function.
VBScript Date CodeTo display this to the user, you need to output it like you would anything else - for example, using the document.write() method.
Or even better, you could put the date into a variable first, then output the variable:
Both these result in: Note: If this is blank, your browser probably doesn't support VBScript. Try using Internet Explorer. VBScript Date FormatYou 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:
Long FormatTo use long date format, you pass the FormatDateTime() an argument of 1.
This results in: Short FormatTo use long date format, you pass the FormatDateTime() an argument of 2.
This results in: Enjoy this website?
Oh, and thank you for supporting Quackit! |
FREE Hosting!With every domain name you register with ZappyHost, you get FREE (ad supported) hosting.PLUS you get:
Featured Template:
(Build your websites in minutes!) |