xref: /csrg-svn/usr.bin/f77/libU77/idate_.c (revision 23030)
12398Sdlw /*
2*23030Skre  * Copyright (c) 1980 Regents of the University of California.
3*23030Skre  * All rights reserved.  The Berkeley software License Agreement
4*23030Skre  * specifies the terms and conditions for redistribution.
52398Sdlw  *
6*23030Skre  *	@(#)idate_.c	5.1	06/07/85
7*23030Skre  */
8*23030Skre 
9*23030Skre /*
102398Sdlw  * return date in numerical form
112398Sdlw  *
122398Sdlw  * calling sequence:
132398Sdlw  *	integer iarray(3)
142398Sdlw  *	call idate(iarray)
152398Sdlw  * where:
162398Sdlw  *	iarray will receive the current date; day, mon, year.
172398Sdlw  */
182398Sdlw 
192398Sdlw #include <sys/types.h>
2013583Swnj #include <sys/time.h>
212398Sdlw 
222398Sdlw idate_(iar)
232398Sdlw struct { long iday; long imon; long iyer; } *iar;
242398Sdlw {
252398Sdlw 	struct tm *localtime(), *lclt;
262398Sdlw 	long int time(), t;
272398Sdlw 
282398Sdlw 	t = time(0);
292398Sdlw 	lclt = localtime(&t);
302398Sdlw 	iar->iday = lclt->tm_mday;
312398Sdlw 	iar->imon = lclt->tm_mon + 1;
322398Sdlw 	iar->iyer = lclt->tm_year + 1900;
332398Sdlw }
34