Different Time Formats

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 202
SELECT CONVERT(date,GETDATE()) --2014-09-09
SELECT CONVERT(VARCHAR(32),GETDATE(),126); -- 2014-09-09T10:59:39.497
SELECT LEFT(REPLACE(CONVERT(VARCHAR(32),GETDATE(),126),':','_'),19); -- 2014-09-09T10_59_39
SELECT REPLACE(CONVERT(VARCHAR(19),GETDATE(),126),':','_'); -- 2014-09-09T10_59_39

Comments or Responses

Login to post response