Convert date and time
For SQl Server 2008 you can use convert function like below.

--For output format mm-dd-yyyy
declare @d datetime = getdate() 
select convert(varchar(10), @d, 110)

--For output format yyyy-mm-dd
declare @d datetime = getdate() 
select convert(varchar(10), @d, 120)


If you are using SQL Server 2012 and later, the new format function works fine too. Example below.

--For output format mm-dd-yyyy    
declare @d datetime = getdate()
select format(@d,'MM-dd-yyyy', 'en-US')

--For output format yyyy-mm-dd
declare @d datetime = getdate() 
select format(@d,'yyyy-MM-dd', 'en-US')