[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

bug in ctime()?



Hi there,

  I suppose I found a bug in libc (V5.2.18 - don't have a newer version
around, maybe someone else can check the newer version), but according to
the ctime man page the following source yields a wrong result:

/*
** ctime.c
**
**   Author  :  Benedikt Eric Heinen (beh)
**   Date    :  Thu Dec 26 17:39:16 1996
**
** purpose:
**   sample program for a bug(?) in ctime()
*/
#include <stdio.h>
#include <time.h>

int
main(
  void)
{
  time_t tt=(time_t)0;
  puts(ctime(&tt));
  return(0);
}


The result for this is:

Thu Jan  1 01:00:00 1970



Shouldn't the correct result be 'Thu Jan  1 00:00:00 1970' (one hour
earlier)?


  Benedikt

signoff

---
 Benedikt Eric Heinen  -  Muehlemattstrasse 53  -  CH3007 Bern  -   SWITZERLAND
 email: beh@icemark.thenet.ch				 phone: ++41.79.3547891


RIOT, n.  A popular entertainment given to the military by innocent bystanders.

				     Ambrose Bierce  ``The Devil's Dictionary''



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: