云日志服务 LTS-日期和时间函数:time_format函数
time_format函数
将时间戳类型的日期和时间表达式转换为指定格式的日期和时间表达式。
语法:time_format(expr, format)
参数名称 |
描述 |
类型 |
是否必选 |
---|---|---|---|
expr |
日期和时间表达式,格式为yyyy-MM-dd HH:mm:ss.SSS |
String |
是 |
format |
时间格式 |
String |
是 |
返回值类型:String类型
示例:SELECT TIME_FORMAT(current_timestamp(),'%H%i')
类型 |
场景 |
---|---|
查询语句 |
TIME_FORMAT(current_timestamp(),'%H%i') |
返回结果 |
1432 |
format描述:
%a Abbreviation for the week. For example, Sun and Sat.
%b Abbreviation of the month. For example, Jan and Dec.
%c Month. Numeral type. Range: 1-12.
%D Day of the month. The value must be suffixed, for example, 0th, 1st, 2nd, and 3rd.
%d Day of the month. The value ranges from 01 to 31 in decimal notation.
%e Day of the month. The value ranges from 1 to 31 in decimal notation.
%H Hour, 24-hour system.
%h Hour, 12-hour system.
%i Minute. Numeral type. Range: 00–59.
%j Day of the year. The value ranges from 001 to 366.
%k Hour. The value ranges from 0 to 23.
%l Hour. The value ranges from 1 to 12.
%M The English expression of the month, for example, January, December.
%m Month. Numeral format. The value ranges from 01 to 12.
%p AM and PM.
%r Time in the 12-hour format. The format is hh:mm:ss AM/PM.
%S Indicates the second. The value ranges from 00 to 59.
%s Indicates the second. The value ranges from 00 to 59.
%T Time, in the 24-hour format of hh:mm:ss.
%v The first week of the year, Monday is the first day of the week. The value ranges from 01 to 53.
%W The name of the day of the week. For example, Sunday and Saturday.
%w Day of the week. Sunday is day 0.
%Y A 4-digit year, for example, 2020.
%y A 2-digit year, for example, 20.
%% Escape character for%.
- 华为数据库日期函数_GaussDB安装_高斯数据库日期函数
- GaussDB数据库函数_GaussDB函数和操作符_高斯数据库函数-华为云
- GaussDB函数_GaussDB数据库函数_高斯数据库函数_华为云
- GaussDB支持的函数_GaussDB函数类型解析_高斯数据库支持的函数-华为云
- 调用函数_函数调用方式_函数工作流 FunctionGraph-华为云
- GaussDB数据库函数_GaussDB介绍_高斯数据库函数
- 云日志服务怎么使用_云日志服务使用流程_云日志服务LTS-华为云
- 什么是函数工作流_函数托管计算服务_函数工作流 FunctionGraph-华为云
- 如何使用模板创建函数_模板创建函数_函数工作流 FunctionGraph-华为云
- 使用容器镜像部署函数_函数部署_函数工作流 FunctionGraph-华为云