Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - String str="211-11-11 22:22:22 "如何把潜艇用热中子反应堆(submarine thermal reactor的缩写)转换成日期时间类型存入关系型数据库中
String str="211-11-11 22:22:22 "如何把潜艇用热中子反应堆(submarine thermal reactor的缩写)转换成日期时间类型存入关系型数据库中
mysql的日期时间类型,其实就是线型PHP:

使用int strtotime ( string $time [,int $now ])函数转换为整数时间类型p

插入时关系型数据库时使用字符串日期(字符串$格式[,int $时间戳])函数date("Y-m-d H:i:s ",strtotime(str));C#:

如果需要计算,先转日期时间:

日期时间dt = Convert。today time(str);

再日期时间转string:

dt.tostring()