| 1 | /* @(#)fdate.c 19.1 (ES0-DMD) 02/25/03 14:35:59 */ |
| 2 | /*=========================================================================== |
| 3 | Copyright (C) 1995 European Southern Observatory (ESO) |
| 4 | |
| 5 | This program is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU General Public License as |
| 7 | published by the Free Software Foundation; either version 2 of |
| 8 | the License, or (at your option) any later version. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public |
| 16 | License along with this program; if not, write to the Free |
| 17 | Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, |
| 18 | MA 02139, USA. |
| 19 | |
| 20 | Corresponding concerning ESO-MIDAS should be addressed as follows: |
| 21 | Internet e-mail: [email protected] |
| 22 | Postal address: European Southern Observatory |
| 23 | Data Management Division |
| 24 | Karl-Schwarzschild-Strasse 2 |
| 25 | D 85748 Garching bei Muenchen |
| 26 | GERMANY |
| 27 | ===========================================================================*/ |
| 28 | |
| 29 | #include <stdio.h> |
| 30 | #include <sys/time.h> |
| 31 | #include <string.h> |
| 32 | |
| 33 | fdate(str) char *str; { c_fdate(str); } |
| 34 | _fdate(str) char *str; { c_fdate(str); } |
| 35 | fdate_(str) char *str; { c_fdate(str); } |
| 36 | _fdate_(str) char *str; { c_fdate(str); } |
| 37 | FDATE(str) char *str; { c_fdate(str); } |
| 38 | _FDATE(str) char *str; { c_fdate(str); } |
| 39 | FDATE_(str) char *str; { c_fdate(str); } |
| 40 | _FDATE_(str) char *str; { c_fdate(str); } |
| 41 | |
| 42 | static c_fdate(str) |
| 43 | char *str; |
| 44 | { |
| 45 | struct timeval tp; |
| 46 | struct timezone tzp; |
| 47 | |
| 48 | gettimeofday(&tp,&tzp); |
| 49 | strncpy(str,ctime(&tp.tv_sec),24); |
| 50 | } |