From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079038515661.tru64-unix-managers.marc@archive.invalid> From: Salvador Ramirez Date: Sat, 13 Mar 1999 01:04:36 +0000 To: tru64-unix-managers Subject: localtime(3) function output not Y2K? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079038515661 I have done a little C program to get the local time and I used localtime(3) to do that but I get a not expected output. In /usr/include/time.h is defined the struct "tm" which one of its fields is an integer called tm_year for storing the year but this field show only (at this time) 99!. Another question is if you have man page for the "time" C function? on my system I only get the man pages for time(1) command. My program looks like the following: ... struct tm *test; time_t tim; tim = time(0); test = (struct tm *)localtime( &tim ); printf("%d\n", test->tm_year); ... I know that asctime(3) return a string that have the complete specification of the year (1999) but I would like to use localtime because it return the day, hour, ..., year in different fields that you can manipulate. Is this a localtime bug or now there is a function that get the current century?.. I don't think so but it maybe would be useful Thank you in advance! ---sram If God does not exist, it would be necessary to invent him --Voltaire Salvador Ramirez Flandes PROFC, Universidad de Concepcion, CHILE http://www.profc.udec.cl/~sram mailto:sram@profc.udec.cl