cdate(time)白天开市时间可以设置成
if (cdate(time)>cdate("09:00:00") and (cdate(time)<=cdate("10:15:00")) or (cdate(time)<=cdate("11:30:00") and cdate(time)>cdate("10:30:00")) or (cdate(time)<=cdate("15:00:00") and cdate(time)>cdate("13:30:00")) then
不过对于螺纹的夜盘时间怎么写呢?
我写成
(cdate(time)<=cdate("24:00:00")) 报错
编译器错误‘13’
类型不匹配:‘cdate’
所以无法用
if (cdate(time)<=cdate("24:00:00") and cdate(time)>cdate("21:00:00")) or (cdate(time)<=cdate("01:00:00") and cdate(time)>cdate("00:00:00"))
表示夜盘时间
请问夜盘时间怎么写呢?
时间的格式上是没有24点的,建议你使用金字塔时区,这样引用时间会更加方便
金字塔时区怎么引用?哪里有详细说明?怎么引用能详细说说吗?
不对呀,软件本来选的就是“交易所/金字塔时区(推荐)”,因为缺省的就是这个
但cdate(time)取的还是计算机的时间
你可以具体描述一下你想怎么取时间,不然我们这里没法给你准确的帮助
就是用
if (cdate(time)<=cdate("24:00:00") and cdate(time)>cdate("21:00:00")) or (cdate(time)<=cdate("01:00:00") and cdate(time)>cdate("00:00:00"))
之类的判断呀
但是用application.MsgOut cdate(time)显示的都是计算机时间而不是+4个小时的时间,怎么办?
if (cdate(time)<=cdate("23:59:59") and cdate(time)>cdate("21:00:00")) then
set Report1 = marketdata.GetReportData(laoheyue,laoshichang)
有时区转换函数的,比如
Set MarketInfo = marketdata.GetMarketInfo("AG","SQ") '取上期夜盘市场市场信息
Application.MsgOut MarketInfo.TimeZoneConver(Now,0) '将当前计算机是转换成上期夜盘市场时区
[此贴子已经被作者于2016/3/1 22:25:57编辑过]
Set MarketInfo = marketdata.GetMarketInfo("AG","SQ") '取上期夜盘市场市场信息
Application.MsgOut MarketInfo.TimeZoneConver(Now,0) '将当前计算机是转换成上期夜盘市场时区
显示的是日期+时间,2016/3/2 11:55:16
我想只显示时间不显示日期即11:55:16怎么写?
ti = MarketInfo.TimeZoneConver(Now,0) '将当前计算机是转换成上期夜盘市场时区
Application.MsgOut FormatDateTime(ti,3)
看下formatdatetime这个函数