Y2K and SRS

Louis Jones lmj at pasteur.fr
Thu Jan 6 03:19:04 EST 2000


In article <fTc*-Yhho at news.chiark.greenend.org.uk>,
Tim Cutts  <timc at chiark.greenend.org.uk> wrote:
>In article <84slqi$4j7$1 at mach.vub.ac.be>,
>Guy Bottu <gbottu at bigben.vub.ac.be> wrote:
>>  case 's':  /* short */
>>    if (timeRec->tm_year >= 100)
>>      sprintf (timeStr, "%0d/%0d/%0d", timeRec->tm_mon+1,
>>                                  timeRec->tm_mday,
>>                                  timeRec->tm_year + 1900);

Here I prefer to have 2 digit years, so I used:


     sprintf (timeStr, "%0d/%0d/%0d", timeRec->tm_mon+1,
                                 timeRec->tm_mday,
                                 timeRec->tm_year % 100);

This will give (using the test program from Tim Cutts):

Current time:
short: 1/6/00
long:  06-Jan-2000 15:31
date: 06-Jan-2000

>>    else
>>      sprintf (timeStr, "%0d/%0d/%0d", timeRec->tm_mon+1,
>>                                  timeRec->tm_mday,
>>                                  timeRec->tm_year);
>>    break;
>

SNIP--SNIP--SNIP

Test program from Tim Cutts was here

Louis Jones                             /\
Institut Pasteur                o      /  \
28, rue du Dr. Roux            /<(*)/\/    \
75724 Paris CEDEX 15          /->/ /        \
France                         (*)/          \
mailto:lmj at pasteur.fr      ______/            \___

--

-- 
--
Louis Jones                             /\
Institut Pasteur                o      /  \
28, rue du Dr. Roux            /<(*)/\/    \





More information about the Bio-srs mailing list