Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串,例如。“2008-01-01 11:09:11”。
如何将其转换为日期时间?
如果您在SELECT语句或存储过程调用中将其用作文字字符串,则转换是自动的。
SELECT
如果你把它放在一个变量中,convert(datetime, @stringDateTime)应该可以工作。
convert(datetime, @stringDateTime)
时间戳数据类型被定义为varbinary(8) null并且它与时间或日期是否有任何关系。
varbinary(8) null
您不能在 sybase 中将时间戳转换为日期时间。