QTP获取系统时间并自定义格式
2012-08-03 16:47
387 查看
function GetDateTime(Nowstr)
Dim Currentdatetime
Dim YY 'Year
Dim MM 'Month
Dim DD 'Day
Dim HH 'Hour
Dim Min 'MInute
Dim SS 'Second
Currentdatetime=now()
YY=Year(Currentdatetime)
MM=Month(Currentdatetime)
If MM<10 Then
MM="0"&MM
End If
DD=Day(Currentdatetime)
If DD<10 Then
DD="0"&DD
End If
HH=Hour(Currentdatetime)
If HH<10 Then
HH="0"& HH
End If
Min=Minute(Currentdatetime)
If Min<10 Then
Min="0"&Min
End If
SS=Second(Currentdatetime)
If SS<10 Then
SS="0"&SS
End If
Nowstr=YY&"-"&MM&"-"&DD&" "&HH&":"&Min
end function
Dim Currentdatetime
Dim YY 'Year
Dim MM 'Month
Dim DD 'Day
Dim HH 'Hour
Dim Min 'MInute
Dim SS 'Second
Currentdatetime=now()
YY=Year(Currentdatetime)
MM=Month(Currentdatetime)
If MM<10 Then
MM="0"&MM
End If
DD=Day(Currentdatetime)
If DD<10 Then
DD="0"&DD
End If
HH=Hour(Currentdatetime)
If HH<10 Then
HH="0"& HH
End If
Min=Minute(Currentdatetime)
If Min<10 Then
Min="0"&Min
End If
SS=Second(Currentdatetime)
If SS<10 Then
SS="0"&SS
End If
Nowstr=YY&"-"&MM&"-"&DD&" "&HH&":"&Min
end function
相关文章推荐
- QTP获取系统时间并自定义格式
- MATLAB获取系统时间的方法和格式输出
- QTP获取当前系统时间
- 使用js时,如何获取系统当前时间并且得到格式为"yyyy年MM月"的日期
- QT获取系统时间,以及设置日期格式
- [Java]获取自定义格式的时间
- 获取系统时间格式
- JAVA获取不同格式的系统时间(时间为String类型)
- MATLAB获取系统时间的方法和格式输出
- Android获取系统时间格式
- QT获取系统时间,以及设置日期格式
- C获取系统时间(字符串格式)
- SQL获取系统当前时间按“mm/dd/yyyy”格式输出
- C# 获取系统时间及时间格式
- Java 获取系统当前时间,格式(2015-05-06 21:26:39.82)
- Js:消息弹出框、获取时间区间、时间格式、easyui datebox 自定义校验、表单数据转化json、控制两个日期不能只填一个
- QT获取系统时间,以及设置日期格式
- C# 获取系统当前时间 长格式
- C# 获取系统时间及时间格式
- 获取系统时间的各种格式。。