QTP日期格式

2010-09-15  杨柳风 

前几天一直在想如何把日期格式(因为QTP自带的飞机订票中要用到这种格式)变成:mm/dd/yy的格式,在QTP帮助里有date format的信息,大家要看仔细,有这样的specified in your computer's regional settings.所以要把日期变成什么样的格式,只要把自己电脑里的日期格式设置成需要的格式,再用date formate函数就OK了,至于0.1.2.3.4四个数值到底有什么区别,看看description里就知道了,实在不行,就一个一个试试吧. Date Format Constants
Constant Value Description
vbGeneralDate 0 Display a date and/or time. For real numbers, display a date and time. If there is no fractional part, display only a date. If there is no integer part, display time only. Date and time display is determined by your system settings.
vbLongDate 1 Display a date using the long date format specified in your computer's regional settings.
vbShortDate 2 Display a date using the short date format specified in your computer's regional settings.
vbLongTime 3 Display a time using the long time format specified in your computer's regional settings.
vbShortTime 4 Display a time using the short time format specified in your computer's regional settings.
474°/4743 人阅读/0 条评论 发表评论

登录 后发表评论