MySql教程
MySql用户管理
MySQL数据库
MySql表格和视图
MySQL查询
MySQL索引
MySQL子句
MySQL授权
MySql控制流
MySQL条件
MySQL连接
MySQL键
MySQL触发器
MySQL聚合函数
MySQL常用
MySQL正则表达式
MySql差异性

MySQL time_format()函数

time_format()是MySQL日期/时间函数。用于将时间格式化为指定的给定format_mask。

语法

select time_format(time, format_mask)

参数:

time: 要格式化的时间
Format_mask : 要格式化的时间按时间应用的是选项列表
VALUE DESCRIPTION
%f 微秒(000000至999999)
从MySQL 4.1.1开始可用%f
%H 小时(通常为00到23,但可以更高)
%h 小时(00到12)
%I 小时(00到12)
%i 分钟(00到59)
%p 上午或下午
%r 采用12小时制AM或PM格式的时间(hh: mm: ss AM/PM)
%S 秒(00到59)
%s 秒(00到59)
%T 24小时制时间(hh: mm: ss)

示例1

MySQL Datetime time_format()Function
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4