Sideway
output.to from Sideway
Draft for Information Only

Content

VBScript Date/Time Functions
 Now Function
  Syntax
  Return
  Remark
  ReqVersion
 Date Function
  Syntax
  Return
  Remark
  ReqVersion
 Time Function
  Syntax
  Return
  Remark
  ReqVersion
  Examples

VBScript Date/Time Functions

Functions for manipulating date or time dexpression.

%>

Now Function

last updated 20 Sep 2017

Create a date from the current date of a local computer system with format according to the date setting of the local computer system.

Syntax

Now

Return

Returns a Variant of Date data subtype containing the date obtained from the current date of a local computer system with format according to the date setting of the local computer system.

Remark

  • The format of the current date and time value returned by the Now function depends on the date and time setting of the local computer system.

ReqVersion

1

Date Function

last updated 17 Sep 2017

Create a date part of the date from the current date of a local computer system with format according to the date setting of the local computer system.

Syntax

Date

Return

Returns a Variant of Date data subtype containing the date part of a date obtained from the current date of a local computer system with format according to the date setting of the local computer system.

Remark

  • The format of the current date value returned by Date function depends on the date setting of the local computer system.

ReqVersion

1

Time Function

last updated 21 Sep 2017

Create a time part of the date from the current date of a local computer system with format according to the time setting of the local computer system.

Syntax

Time

Return

Returns a Variant of Date data subtype containing the time part of a date obtained from the current date of a local computer system with format according to the time setting of the local computer system.

Remark

  • The format of the current time value returned by Date function depends on the time setting of the local computer system.

ReqVersion

1

Examples

Examples of Now, Date, and Time functions

ASP VbScript Command:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
<script runat="server" language="VBScript">

Function printdata
cmda=array("Now","Now()","Date","Date()","Time","Time()")
 ucnt =UBound(cmda) : call heading
vars="":dsp_x
End Function
Dim abb,cnt,cmda,cmp,dai,dlt,dte,dad,e,fnd,flg,fir,f_dw,gbd,hor,i,ild,k,mth,min,num,pnn,pi,sec,str1,str2,str,strs,tme,tmp,ucnt,var,vars,varx,wkd,x,z:varx=0
Function heading:If var=1 Then:tmp="":Else:tmp="<b>vars</b>":End If:For i=0 to ucnt:tmp=tmp&"<b>"&rmv_ctrl(cmda(i))&", TypeName</b>":Next:Response.Write "Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VB Version 8.0<br />"&"<i>"&tmp&"</i>":End Function
Function dsp_x:Dim tmp_a,tmp_b,i:If varx=0  Then:Execute vars:End If:If var=1 Then:tmp_a="":Else:tmp_a=rmv_ctrl(vars):End If:For i=0 to ucnt:tmp_b=cmd_b(cmda(i)):if i/2=fix(i/2) Then:tmp_b="<b>"&tmp_b&"</b>":End If:tmp_a=tmp_a&tmp_b:Next:Response.Write "<i>"&tmp_a&"</i>":End Function
Function rmv_ctrl(blk_str):Select Case blk_str:Case chr(0):blk_str="NUL":Case chr(1):blk_str="SOH":Case chr(2):blk_str="STX":Case chr(3):blk_str="ETX":Case chr(4):blk_str="EOT":Case chr(5):blk_str="ENQ":Case chr(6):blk_str="ACK":Case chr(7):blk_str="BEL":Case chr(8):blk_str="BS":Case chr(9):blk_str="HT":Case chr(10):blk_str="LF":Case chr(11):blk_str="VT":Case chr(12):blk_str="FF":Case chr(13):blk_str="CR":Case chr(14):blk_str="SO":Case chr(15):blk_str="SI":Case chr(16):blk_str="DLE":Case chr(17):blk_str="DC1":Case chr(18):blk_str="DC2":Case chr(19):blk_str="DC3":Case chr(20):blk_str="DC4":Case chr(21):blk_str="NAK":Case chr(22):blk_str="SYN":Case chr(23):blk_str="ETB":Case chr(24):blk_str="CAN":Case chr(25):blk_str="EM":Case chr(26):blk_str="SUB":Case chr(27):blk_str="ESC":Case chr(28):blk_str="FS":Case chr(29):blk_str="GS":Case chr(30):blk_str="RS":Case chr(31):blk_str="US":Case chr(127):blk_str="DEL":End Select:rmv_ctrl=blk_str:If IsNull(blk_str) OR IsEmpty(Blk_str) OR blk_str="" OR IsNumeric(Blk_str) Then:Else:rmv_ctrl=Replace(Replace(Replace(Replace(Replace(blk_str,"&","&amp;"),"  "," &nbsp;"),"""","&quot;"),"<","&lt;"),">","&gt;"): End If :End Function
Function cmd_b(blk_str):cmd_b="["&cmd_x(blk_str)&"], "&cmd_x("TypeName("&blk_str&")"):End Function
Function cmd_x(blk_str):On Error Resume Next:Dim xans, tmp:xans="":tmp="":execute "xans="&blk_str:If Err.Number <> 0  Then:xans=cmd_x("TypeName("&blk_str&")"):Select Case xans:Case 9::Case Else:xans="error":End Select:End If:If IsArray(xans)=False Then:cmd_x=rmv_ctrl(xans): Else:tmp=lst_arry(xans):cmd_x=trim(tmp):End If:End Function
Function lst_arry(blk_str):Dim tmp,i,q:q="""":tmp="":For i=0 to UBound(blk_str):if VarType(blk_str(i))>1 And VarType(blk_str(i))<6 Then:q="'":End If:tmp=tmp&" "&q&rmv_ctrl(blk_str(i))&q:Next:lst_arry=trim(tmp):End Function
</script>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 
        <style type="text/css">
           i {display:table-row}
           u,b {display: table-cell}
        </style>
    </head>
    <body>
<%call printdata %>
    </body>
</html>
HTML Web Page Embedded Output:

©sideway

ID: 171000012 Last Updated: 6/11/2017 Revision: 1

IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 7

Culture

Chinese 1097

English 337

Reference 67

Computer

Hardware 149

Software

Application 195

Digitization 25

Numeric 19

Programming

Web 612

HTML 65

Common Color 1

Html Entity (Unicode) 1

Html 401 Special 1

CSS 58

ASP.NET 62

Regular Expression 1

OS 389

MS Windows

Windows10 1

.NET Framework 1

DeskTop 7

Knowledge

Mathematics

Formulas 8

Algebra 21

Number Theory 206

Trigonometry 18

Geometry 18

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Physics

Electric 20

Biology 1

Geography 1


Copyright © 2000-2020 Sideway . All rights reserved Disclaimers last modified on 06 September 2019