날짜 창법
Date windowing날짜 창법은 두 자릿수 연도를 가진 날짜를 네 자릿수 연도를 가진 날짜로 변환하는 방식이다.[1] 세기가 바뀌는 해를 날짜 창의 피벗 연도라고 한다.[2] 날짜 표시는 기존 컴퓨터 시스템의 2000년 문제를 해결하기 위해 사용된 몇 가지 기술 중 하나이다.[3]
추리
데이터가 수십 년밖에 되지 않은 조직과 기관의 경우, 두 자릿수 연도를 네 자리 연도로 전환할 때 필요한 대규모 변환 및 테스트보다 "날짜 윈도우 설정" 솔루션이 쉽고 경제적이라고 간주되었다.[4][3]
윈도우 설정 방법
날짜 창을 결정하는 데 사용되는 세 가지 주요 방법이 있다.
- 고정 피벗 연도: 가장 간단하게 코드화할 수 있으며 대부분의 비즈니스 날짜에 적용 가능
- 슬라이딩 피벗 연도: 생년월일에 일반적으로 사용되는 현재 연도에서 일정 부분을 빼서 결정한다.
- 가장 가까운 날짜: 세 가지 다른 해석(지난 세기, 금세기, 다음 세기)을 현재의 날짜와 비교하며, 세 가지 중에서 가장 가까운 날짜를 선택한다.
포커스
Information Builder의 FOCUS "Century Awaren" 구현을[5] 통해 사용자는 현장별, 파일별 설정에 집중할 수 있었다.
이러한 유연성은 세 가지 주요 메커니즘 중 가장 좋은 것을 제공했다. 학교에서는 LastDonors가 BirthDate라는 필드를 사용하여
- DEFCENT=19 YRTHRESH=31, 1931-2030년생 대상.
2031년생들은 2049년 이전에 기부를 할 것 같지 않은데, 그 때쯤이면 1931년생들은 118세가 될 것이고, 현재 기증자일 것 같지 않다. DEFCENT와 YRTHRESH는 현재 학생과 최근 졸업생이 포함된 파일의 다른 가치를 사용할 것이다.
예
유닉스 및 윈도우즈 시스템에는 시스템의 고정 피벗 연도를 설정하는 환경 변수가 있다. 피벗 연도 이후의 어느 해는 이 세기(21세기)에 속하며, 피벗 연도 이전 또는 같은 해는 지난 세기(20세기)에 속할 것이다.[6]
Microsoft Excel 95와 같은 일부 제품은 1920-2019년의 창을 사용했는데, 이는 2000년 문제가 해결된 후 20년 만에 윈도우 버그가 재발할 수 있는 가능성을 가지고 있었다.[7]
아래는 고정된 날짜 창구 COBOL 코드의 간단한 예로서, 보통 비즈니스 날짜의 세기를 계산하는 데 종종 사용된다.
IF 영수증-날짜-년 >= 60 이동 19 토 영수증-날짜-세기 기타 이동 20 토 영수증-날짜-세기 엔드-IF. 위의 코드는 1960년부터 2060년까지의 고정된 날짜 창을 설정한다. 그것은 어떤 날짜도 1960년 이전이 아니라고 가정하고, 2060년까지 일해야 한다.[3]
참고 항목
참조
- ^ Bridis, Ted (16 March 1999). "Temporary Y2K fix may last only a generation". Online Athens. Archived from the original (html) on 4 March 2016. Retrieved 13 February 2020.
Using windowing, programmers instruct software to guess the century for dates that fall within a specific "window" of time, such as the next three decades. The computer interprets the year based on a future so-called hinge date, or pivot, that programmers choose arbitrarily
- ^ Healton, Gilbert (12 July 2014). "The Best of Dates, The Worst Of Dates". Archived from the original (html) on 13 February 2020. Retrieved 13 February 2020.
A pivot year, also known as date windowing, takes a two-digit year and expands it to determine which century the year is in. Typically the year is converted to either a full four-digit year or into the year-1900 format, as appropriate to the application at hand.
- ^ a b c Raymond B. Howard. "The Case for Windowing: Techniques That Buy 60 Years". Year/2000 Journal (Mar/Apr 1998).
Windowing is a long-term fix that should keep legacy systems working fine until the software is redesigned...
- ^ McNish, Larry (30 December 2019). "The Y2K Pivot Year Problem". Archived from the original on 15 January 2020. Retrieved 13 February 2020.
The choice of the actual pivot year was made by companies based on their historical records. It was in no way an industry standard, nor was this approach in any way professionally recommended. But it would work for a while.
- ^ Kruskopfs, Peter. "Solving the Date Dilemma". Information Builders. p. 4. Archived from the original on 27 December 1996. Retrieved 2 March 2020.
expanded version of the sliding windows technique .. File and field level settings
- ^ "Chapter 1: Pivot Year". APPX Software, Inc. 2003. Archived from the original (html) on 22 September 2012. Retrieved 13 February 2020.
By defining a pivot year, you direct APPX to determine what century a particular year belongs to. For example, if the pivot year is set to 35, then any date field with a year greater than 35 will be assumed by APPX to have a century value of 19. Any date field with a year less than or equal to the pivot year will be assumed by APPX to have a century value of 20.
- ^ Livingston, Brian (9 February 1999). "COMPUTING Spot & fix Y2K problems in Windows 9x & NT". CNN. Archived from the original (html) on 17 May 2001. Retrieved 13 February 2020.
The other common behavior that Windows users will experience involves dates in spreadsheet programs such as Microsoft Excel, Lotus 1-2-3, and Corel Quattro Pro. If you have typed all your dates with four-digit years (such as 1/1/1999 and 1/1/2000), you should be fine. But if you have typed two-digit years (such as 1/1/29), you may be surprised at the way different programs handle the date.