By Fred Wild

Dr. Dobb's Journal August 1998

/* Get 16-bit integer year in big-endian format */
unsigned int year =3D Y[0] * 0x0100 + Y[1];
if (year >=3D (=910=92 * 0x0100 + =910=92))
   /* Get the year using the legacy format */
   year =3D 1900 + (Y[0] - =910=92) * 10 + (Y[1] - =910=92);

Example 1: Y2K challenges.

Back to Article


Copyright © 1998, Dr. Dobb's Journal