sql中的日期时间

sql中的日期时间_第1张图片
实例:

MySQL:
sql中的日期时间_第2张图片
2、sqlserver

使用Convert()函数:

select convert(char(10),GetDate(),120) as Date
第3个参数就是用来设置日期类型数据的显示样式的,下面介绍几种样式的参数:

sql中的日期时间_第3张图片
sql中的日期时间_第4张图片

你可能感兴趣的:(sql)