Appearance
GetTime
返回输入时间的UNIX时间戳。
业务属性
属性 | 含义 | 说明 | 输入限定 | 示例值 |
---|---|---|---|---|
enable | 是否启用该控件,未启用时不编译 | 是否编译 | 选择值 | 启用 |
name | 控件返回值命名 | 控件输出值变量名 | 常量 | GetTime |
text | 与控件关联的文本 | 设计页控件显示 | 常量 | GetTime |
date | 时间 | 常量 /流程变量 | #{date} |
目前仅支持以下四种时间格式:
- yyyyMMdd
- yyyy-MM-dd
- yyyyMMddHHmmss
- yyyy-MM-dd HH:mm:ss
不符合以上格式的时间都将抛出illegal date format
异常。
使用示例
输入常量
时间输入:2023-11-11 11:11:11

输出控件返回getTime
,data属性为:
json
{
"getTime": "#{getTime}"
}
{
"getTime": "#{getTime}"
}

使用curl请求接口:
$ curl http://localhost:6636/api/getTime
$ curl http://localhost:6636/api/getTime
接口返回:
json
{
"getTime": 1699672271
}
{
"getTime": 1699672271
}
输入指定变量
时间输入:#{body.time}

使用curl请求接口:
$ curl http://localhost:6636/api/getTime -d "{ \"time\": \"2023-11-11 11:11:11\" }"
$ curl http://localhost:6636/api/getTime -d "{ \"time\": \"2023-11-11 11:11:11\" }"
接口返回:
json
{
"getTime": 1699672271
}
{
"getTime": 1699672271
}