成交时间
适用市场
| 市场 | 品种 |
|---|---|
| 香港市场 | 股票、期权、窝轮、牛熊证、界内证、ETFs、期货 |
| 美国市场 | 股票、期权、ETFs、期货 |
| A股市场 | 股票、ETFs |
| 新加坡市场 | 期货 |
| 日本市场 | 期货 |
execution_time
接口说明
通过成交 ID 查询成交时间
你可以通过以下 2 个函数获得成交 ID :
execution_time(excecutionid,time_zone=TimeZone.MARKET_TIME_ZONE)
参数
| 参数名 | 类型 | 说明 | 默认值 | 范围 |
|---|---|---|---|---|
| excecutionid | string | 订单ID | -- | -- |
| time_zone | TimeZone | 时区 | TimeZone.MARKET_TIME_ZONE | -- |
返回
返回类型:datetime
示例说明
查询成交 ID 为“10000000000000001”的成交时间。
executiontime = execution_time(excecutionid="10000000000000001",time_zone=TimeZone.MARKET_TIME_ZONE)
print(executiontime)
print(executiontime.strftime("%Y-%m-%d %H:%M:%S")) # 格式化日期和时间
print(executiontime.hour) # 打印小时
print(executiontime.minute) # 打印分钟
print(executiontime.second) # 打印秒
示例返回值
2023-07-31 09:30:00-04:00
2023-07-31 09:30:00
9
30
0