0

For example, I want to convert the Gregorian date in Query below to the Persian date

select convert(GregorianDate ,persianDate) date
from TOrder
where orderid=?


result:

date:
2021-01-25 ----->convert to ----> 1399/11/06
1
  • 1
    Complete (and closed) duplicate on SO
    – SMor
    Jan 25, 2021 at 16:01

1 Answer 1

6

use this function sql server (MSSQL)

select format(GETDATE(),'yyyy/MMMM/dddd','fa')
select format(GETDATE(),'yyyy/MMM/dd','fa')
select format(GETDATE(),'yy/MM/dd','fa')
select format(GETDATE(),'yyyy/MM/dd','fa')

enter image description here

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.