sql server - best way to get iso into usa format -
trying convert date string usa format
'20150316 16:28' '3/16/2015 4:28 pm'
(note: 24hr format fine too)
the predefined format "g" give date time in format:
select format(cast('20150316 16:20' datetime), 'g')
update:
select format( cast('20150316 16:20' datetime), 'd') + ' ' + format( cast('20150316 16:20' datetime), 'hh:mm')
produces 3/16/2015 16:20
see these articles predefined , custom date time formats:
https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
note these vary culture.
Comments
Post a Comment