- convert
varchar
, date
, varchar
.
format() with 'ar-SA'
, , 1 , convert()
131
.
select Method='multiconvert'
,conversion = convert(varchar(10)
,convert(date,convert(varchar(12),getdate(),131),103),112)
union all
select 'format'
, format ( getdate(), 'yyyyMMdd', 'ar-SA' )
union all
select 'style131'
,convert(varchar(12),getdate(),131)
Demo version of rexter: http://rextester.com/LIX82417
returns
+--------------+--------------+
| Method | conversion |
+--------------+--------------+
| multiconvert | 14380616 |
| format | 14380615 |
| style131 | 16/06/1438 |
+--------------+--------------+
source
share