Convert Julian Date to YYYY-MM-DD

后端 未结 8 1114
心在旅途
心在旅途 2021-01-06 16:11

I have searched far and wide, but I can\'t seem find a way to convert julian to yyyy-mm-dd.

Here is the format of my julian:

The Julian format

8条回答
  •  没有蜡笔的小新
    2021-01-06 16:52

    Edit: leaving this answer for Oracle and MySQL users
    This will not work in T-SQL.

    Use this:

    MAKEDATE(1900 + d / 1000, d % 1000)
    

    For example:

    SELECT MAKEDATE(1900 + 95076 / 1000, 95076 % 1000)
    

    This returns March, 17 1995 00:00:00.

    SQLFiddle

提交回复
热议问题