-- YYYY-MM-DD SELECT CONVERT(varchar(10), GETDATE(), 120) -- YYYY-MM-DD hh:mm:ss SELECT CONVERT(varchar(19), GETDATE(), 120)UPDATE:
Depending on the input date format, an additional step may be necessary.
SELECT CONVERT(varchar(10), CONVERT(datetime, '20080730 00:00:00.000', 120), 120)
No comments:
Post a Comment