什么日历似乎是从 1800 年 12 月 28 日开始计算天数的?

发布于 2024-08-28 10:08:03 字数 503 浏览 6 评论 0 原文

我的任务是从一些奇怪的旧系统中读取一些数据。
该系统包含许多日期,但它们的格式都很奇怪。它们是范围从大约 55,00080,000 的整数。

我确实知道两个日期:

58,112 equals February 5, 1960  (originally written as Feb 2,1960 [*])
61,439 equals March 16, 1969

[*] This typo explains some of the comments initially challenging the
    leap-year awareness of the calendar.

在我看来,这些整数是自 1800 年 12 月 28 日以来经过的天数。但我认为这是一个开始日历的非常奇怪的日期。闰年可能会发生一些事情,而这会在以后引起问题。

有谁认识这个日历吗?谁能告诉我将这些整数转换为人类可读日期的正确方法是什么?

I have been tasked to read in some data from some weird old system.
The system contains many dates but they are all oddly formatted. They are integer numbers ranging from approximately 55,000 to 80,000.

I know two dates for certain:

58,112 equals February 5, 1960  (originally written as Feb 2,1960 [*])
61,439 equals March 16, 1969

[*] This typo explains some of the comments initially challenging the
    leap-year awareness of the calendar.

It appears to me that those integer numbers are the number of days elapsed since December 28, 1800. But I think that's a very strange date to start a calendar on. There is probably going something on with leap years and what-not that is going to cause problems later on.

Does anyone recognise this calendar? Can anyone tell me what the proper way is to convert those integers to human readable dates?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

第几種人 2024-09-04 10:08:03

可能是歌乐。我正在使用类似的旧数据库转换为 SQL,它发现文件 (*.dat) 是 clarion

It could be Clarion. I'm working with similar old database conversion to SQL, and it figured out files (*.dat) were clarion

眸中客 2024-09-04 10:08:03

我正在使用一个在儒略历中表示公历日期的系统,如果您想将儒略日期转换为公历,您只需将天数添加到 1800 年 12 月 28 日。

在 SQL Server 中:

SELECT DATEADD(day, 58112, '18001228')

例如。抱歉,我不会说英语。您系统中的基准日期是 1800 年 12 月 28 日。

I'm working with a system representing gregorian dates in julian calendar, if you want to convert a julian date to gregorian, you only need to add the quantity days to December 28 1800.

In SQL Server :

SELECT DATEADD(day, 58112, '18001228')

by example. Sorry, I don't speak english. The base date in your system is December 28 1800.

凑诗 2024-09-04 10:08:03

对我来说听起来像是一个定制系统,但一个相当奇怪的系统:)

一种始终有效的转换方法是使用某种 date_add() 函数 - 你不指定你正在使用哪种语言,但大多数现代语言应该有一种在日期中添加几天的方法。

关于闰年,如果这 2 个日期正确,那么您应该不会有问题,至少有 1 个闰年 betweek 1960 和 1969 :) 绝对值得检查一些最近的日期以确保这一点。

sounds like a bespoke system to me, but a rather strange one :)

one way to convert that will always work is use some sort of date_add() function - you don't specify which language you're using but most modern languages should have a way to add a bunch of days to a date.

regarding leap years, if those 2 dates are correct then you shouldn't have a problem, there was definitely at least 1 leap year betweek 1960 and 1969 :) it's definitely worth checking a few more recent dates just to make sure though.

狼性发作 2024-09-04 10:08:03

这并不奇怪。例如,Javacards 上的日期是从 1986-02-04 开始通过类似方案计算的: http://forums.sun.com/thread.jspa?threadID=5421557&messageID=10894720#10894720

It is not so strange. For example, date on Javacards is calculated by similiar scheme starting from 1986-02-04: http://forums.sun.com/thread.jspa?threadID=5421557&messageID=10894720#10894720

锦上情书 2024-09-04 10:08:03

是的,它是 Clarion 数据文件。使用
Edit1.Text := datetostr(encodedate(1800,12,28) );

Yes it is Clarion Data files. Use
Edit1.Text := datetostr(encodedate(1800,12,28) );

野味少女 2024-09-04 10:08:03

函数convertNumberToDate($number)

enter code here
$dateZero = strtotime('1800-12-28');
$string = "+$number day";
return date('Y-m-d', strtotime($string, $dateZero));
enter code here

函数convertDateToNumber($date)

enter code here
$dateZero = strtotime('1800-12-28');
$day = 86400;
$unix = strtotime($date);
$sub = $unix-$dateZero;
$result = $sub/$day;
return round($result,0);
enter code here

function convertNumberToDate($number)

enter code here
$dateZero = strtotime('1800-12-28');
$string = "+$number day";
return date('Y-m-d', strtotime($string, $dateZero));
enter code here

function convertDateToNumber($date)

enter code here
$dateZero = strtotime('1800-12-28');
$day = 86400;
$unix = strtotime($date);
$sub = $unix-$dateZero;
$result = $sub/$day;
return round($result,0);
enter code here
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文