Prechádzať zdrojové kódy

docs: add time formats refer (#2076)

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>
Jason Lyu 1 rok pred
rodič
commit
c9760c25c3

+ 1 - 0
docs/en_US/sqls/functions/transform_functions.md

@@ -19,6 +19,7 @@ When casting to a datetime type, the supported column type and casting rule are:
 2. If column is bigint or float type, the number will be treated as the milliseconds elapsed since January 1, 1970 00:
    00:00 UTC and converted.
 3. If column is string, it will try to automatically detect the format and convert it to datetime type.
+   - Supported time formats can refer to `github.com/jinzhu/now`'s [TimeFormats](https://github.com/jinzhu/now/blob/f067b166b35a996b9ff5a0f610225e1458f23adc/main.go#L17-L27)
 4. Other types are not supported.
 
 ## CONVERT_TZ

+ 2 - 1
docs/zh_CN/sqls/functions/transform_functions.md

@@ -16,7 +16,8 @@ cast(col,  "bigint")
 
 1. 如果参数为 datetime 类型,则直接返回原值。
 2. 如果参数为 bigint 或者 float 类型,则其数值会作为自 1970年1月1日0时起至今的毫秒值而转换为 datetime 类型。
-3. 如果参数为 string 类型,则会尝试自动识别格式并将其转换为 datetime类型。
+3. 如果参数为 string 类型,则会尝试自动识别格式并将其转换为 datetime 类型。
+   - 支持的时间格式可以参考 `github.com/jinzhu/now` 的 [TimeFormats](https://github.com/jinzhu/now/blob/f067b166b35a996b9ff5a0f610225e1458f23adc/main.go#L17-L27)
 4. 其他类型的参数均不支持转换。
 
 ## CONVERT_TZ