Programing

날짜가 1970 년 1 월 1 일부터 계산되는 이유는 무엇입니까?

lottogame 2020. 10. 30. 07:39
반응형

날짜가 1970 년 1 월 1 일부터 계산되는 이유는 무엇입니까?


날짜 (1970 년 1 월 1 일)를 시간 조작의 기본 표준으로 사용하는 이유가 있습니까? 이 표준은 Java와 Python에서 보았습니다. 내가 아는이 두 언어. 동일한 표준을 따르는 다른 인기있는 언어가 있습니까?

설명해주세요.


유닉스 시간 의 표준입니다 .

Unix 시간 또는 POSIX 시간은 윤초를 계산하지 않고 1970 년 1 월 1 일 자정의 UTC (proleptic Coordinated Universal Time) 이후 경과 된 시간 (초)으로 정의되는 시점을 설명하는 시스템입니다.


날짜 (1970 년 1 월 1 일)를 기본 표준으로 사용

질문은 두 가지 잘못된 가정을합니다.

  • 컴퓨팅의 모든 시간 추적은 1970 년 이후로 수행됩니다.
  • 이러한 추적은 표준입니다.

24 개의 신기원

계산 시간 이 1970 UTC 초부터 항상 추적되는 것은 아닙니다 . 시대 가 인기가 있지만 수십 년 동안 다양한 컴퓨팅 환경에서 적어도 20여 시대를 사용했습니다 . 일부는 다른 세기에서 왔습니다. 0 년부터 2001 년까지의 범위입니다.

다음은 몇 가지입니다.

기원전 1 년 1 월 0 일

AD 1 년 1 월 1 일

1582 년 10 월 15 일

1601 년 1 월 1 일

1840 년 12 월 31 일

1858 년 11 월 17 일

1899 년 12 월 30 일

1899 년 12 월 31 일

1900 년 1 월 1 일

1904 년 1 월 1 일

1967 년 12 월 31 일

1980 년 1 월 1 일

1980 년 1 월 6 일

2000 년 1 월 1 일

2001 년 1 월 1 일

Unix Epoch 공통이지만 지배적이지는 않음

1970 년 초는 유닉스에서 사용 되었기 때문에 인기가 있습니다. 그러나 결코 그렇게 지배적이지는 않습니다. 예를 들면 :

ISO 8601

count-since-epoch가 Unix epoch를 사용한다고 가정하면 버그에 대한 큰 취약성이 열립니다. 이러한 카운트는 사람이 즉시 해독하는 것이 불가능하므로 디버깅 및 로깅시 오류 또는 문제가 쉽게 표시되지 않습니다. 또 다른 문제는 아래에 설명 된 세분성의 모호성입니다.

명확한으로 난 강력하게 대신 직렬화 날짜 - 시간 값을 제안 ISO 8601 : 데이터 문자열이 정수 카운트 이후-시대보다는 교환 YYYY-MM-DDTHH:MM:SS.SSSZ2014-10-14T16:32:41.018Z.

백작 무엇 신기원 때문에

에포크 이후 카운트 시간 추적의 또 다른 문제는 일반적으로 사용되는 최소 4 단계의 해상도를 사용하는 시간 단위입니다.

epoch에서 초, 밀리 초, 마이크로 초 또는 나노초 단위로 계산하는 다른 소프트웨어를 보여주는 다이어그램.


1970 년 1 월 1 일 오전 00:00:00은 POSIX 시간 의 0 점입니다 .


시간 조작의 기준으로 날짜 (1970 년 1 월 1 일)를 사용한 이유가 있나요?

중요한 이유는 없습니다.

Python의 time모듈 C 라이브러리입니다. Ken Thompson에게 왜 획기적인 데이트를 위해 그 날짜를 선택했는지 물어보세요. 누군가의 생일이었을 수도 있습니다.

Excel은 두 가지 시대를 사용합니다. Excel의 다른 버전이 다른 날짜를 사용하는 이유는 무엇입니까?

실제 프로그래머를 제외하고는 아무도 그러한 결정이 내려진 이유를 알 수 없습니다 .

과...

날짜가 선택된 이유중요하지 않습니다 . 그냥 그랬어요.

Astronomers use their own epochal date: http://en.wikipedia.org/wiki/Epoch_(astronomy)

Why? A date has to be chosen to make the math work out. Any random date will work.

A date far in the past avoids negative numbers for the general case.

Some of the smarter packages use the proleptic Gregorian year 1. Any reason why year 1?
There's a reason given in books like Calendrical Calculations: it's mathematically slightly simpler.

But if you think about it, the difference between 1/1/1 and 1/1/1970 is just 1969, a trivial mathematical offset.


why its always 1st jan 1970 , Because - '1st January 1970' usually called as "epoch date" is the date when the time started for Unix computers, and that timestamp is marked as '0'. Any time since that date is calculated based on the number of seconds elapsed. In simpler words... the timestamp of any date will be difference in seconds between that date and '1st January 1970' The time stamp is just a integer which started from number '0' on 'Midnight 1st January 1970' and goes on incrementing by '1' as each second pass For conversion of UNIX timestamps to readable dates PHP and other open source languages provides built in functions.


Q) "Why are dates calculated from January 1st, 1970?"

A) It had to be as recent as possible, yet include some past. There was most likely no significant other reason as a lot of people feel that same way.

They knew it posed a problem if they placed it too far into the past and they knew it gave negative results if it was in the future. There was no need to go deeper in the past as events will most likely take place in the future.

Notes: The mayans, on the other hand, had the need to place events into the past, since the had the knowledge of a lot of past, for which they made a long-term calender. Just to place all the routine phenomena on the calender.

타임 스탬프는 캘린더가 아니라 Epoch입니다. 그리고 나는 마야인들이 같은 관점을 사용하여 장기적인 달력을 만들었다 고 믿습니다. (그들은 과거와의 관계가 없다는 것을 잘 알고 있었으며 더 큰 규모로 볼 필요가 있었다는 것을 의미합니다)


예, C (및 그 가족). 이것은 자바가 가져간 곳입니다.

참고 URL : https://stackoverflow.com/questions/2533563/why-are-dates-calculated-from-january-1st-1970

반응형