
- VBScript Tutorial
- VBScript - Home
- VBScript - Overview
- VBScript - Syntax
- VBScript - Enabling
- VBScript - Placement
- VBScript - Variables
- VBScript - Constants
- VBScript - Operators
- VBScript - Decisions
- VBScript - Loops
- VBScript - Events
- VBScript - Cookies
- VBScript - Numbers
- VBScript - Strings
- VBScript - Arrays
- VBScript - Date
- VBScript Advanced
- VBScript - Procedures
- VBScript - Dialog Boxes
- VBScript - Object Oriented
- VBScript - Reg Expressions
- VBScript - Error Handling
- VBScript - Misc Statements
- VBScript Useful Resources
- VBScript - Questions and Answers
- VBScript - Quick Guide
- VBScript - Useful Resources
- VBScript - Discussion
VBScript TimeSerial Function
The TimeSerial function returns the time for the specified hour, minute and second values.
Syntax
TimeSerial(hour,minute,second)
Parameter Description
Hour, a Required parameter, which is an integer between 0 and 23 or any numeric expression.
Minute, a Required parameter, which is an integer between 0 and 59 or any numeric expression.
Second, a Required parameter, which is an integer between 0 and 59 or any numeric expression.
Example
<!DOCTYPE html> <html> <body> <script language = "vbscript" type = "text/vbscript"> document.write(TimeSerial(20,1,2) & "<br />") document.write(TimeSerial(0,59,59) & "<br />") document.write(TimeSerial(7*2,60/3,15+3)& "<br />") </script> </body> </html>
When you save it as .html and execute it in Internet Explorer, then the above script will produce the following result −
8:01:02 PM 12:59:59 AM 2:20:18 PM
vbscript_date.htm
Advertisements