Line data Source code
1 : /*============================================================================ 2 : * Fortran wrapper for the unix library functions time(2) and gmtime(3) to 3 : * get the current UTC year, month and day. Replaces the non-standard 4 : * Fortran intrinsics TIME and GMTIME for use by DATFIT. 5 : * 6 : * Author: Mark Calabretta, Australia Telescope National Facility 7 : * $Id: utdate.c,v 1.1 2006/10/25 01:50:07 cal103 Exp $ 8 : *===========================================================================*/ 9 : 10 : #include <time.h> 11 : 12 0 : void utdate_(int *year, int *month, int *day) 13 : 14 : { 15 : time_t now; 16 : struct tm *utc; 17 : 18 0 : time(&now); 19 0 : utc = gmtime(&now); 20 : 21 0 : *year = 1900 + utc->tm_year; 22 0 : *month = 1 + utc->tm_mon; 23 0 : *day = utc->tm_mday; 24 : 25 0 : return; 26 : }