温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Delphi 计算儒略日(Julian day)的代码

发布时间:2020-06-12 06:16:18 来源:网络 阅读:571 作者:Mychat_on 栏目:开发技术

将开发过程中比较好的一些内容做个备份,下面内容段是关于Delphi 计算儒略日(Julian day)的内容,应该对大伙也有用途。

function julday(year,month,day:integer;hour:double;gregflag:integer):Double;

var

  jd:double;

  u,u0,u1,u2:double;

begin

  u:=year;

  if (month < 3) then

   u:=u-1;

  u0:= u + 4712.0;

  u1:= month + 1.0;

  if (u1 < 4) then u1:=u1+12.0;

  if gregflag = SE_GREG_CAL then

  begin

    u2:= floor(abs(u) / 100) - floor(abs(u) / 400);

    if (u < 0.0) then u2:=-u2;

    jd:= jd - u2 + 2;

    if ((u < 0.0) and (u/100 = floor(u/100)) and (u/400 <> floor(u/400))) then

      jd :=jd-1;

  end;

  result:=jd;

end;
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI