在 Postgresql 中将儒略日期转换为日历日期 [英] Convert a Julian Date to Calendar date in Postgresql

查看:33
本文介绍了在 Postgresql 中将儒略日期转换为日历日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将儒略日期转换为日历日期,但我找不到正确的 PostgreSQL 函数来执行此操作.

I am attempting to convert a Julian Date into a Calendar Date but I can not find the correct PostgreSQL function to do so.

例如:鉴于 Julian 日期 = 2456782,我希望返回 2014/05/04 之类的内容.

For Example: Given the Julian Date = 2456782, I would want something like 2014/05/04 back.

谢谢,

推荐答案

谷歌搜索postgres julian date"应该会带你到 Postgres 日期文档,其中揭示了 Postgres 中内置了 Julian 日期:

Googling "postgres julian date" should bring you to the Postgres date docs, which reveal that Julian dates are built into Postgres:

SELECT 'J2456782'::DATE;
    date    
------------
 2014-05-04

这篇关于在 Postgresql 中将儒略日期转换为日历日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆