Date Compression and Year 2000 Challenges

By Robert L. Moore and D. Gregory Foley

Dr. Dobb's Journal May 1998

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.

Back to Article


Copyright © 1998, Dr. Dobb's Journal