Date Compression and Year 2000 Challenges
By Robert L. Moore and D. Gregory Foley, May 01, 1998
Ultimately, fixing Y2K problems is about fixing storage overflow, and there are a variety of solutions that address the problem. Bob and Greg examine some of these solutions, focusing on date compression.
Date Compression and Year 2000 Challenges
MMDDYYYY to CYYDDD
Represent YYYY as (Y1)(Y2)(Y3)(Y4). Then C =
(Y1*10+Y2)-19. The "YY" in the CYYDDD are Y3 and Y4.
Use MMDDtoDDD.c (Listing Three; available
electronically; see "Resource Center," page 3) to
complete the conversion.
Example 1: MMDDYYYY to CYYDDD.
Copyright © 1998, Dr. Dobb's Journal