/* * secs.c * * Copyright (c) 1997-2004 DF7BE * * $Id$ * * Logbuchprogramm DF7BE * Amateur-Radio log by DF7BE * Utility to print out seconds since 01.01.1970, 00:00 UTC * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the license, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA ( or visit * their web site at http://www.gnu.org/ ). * * * Modification documentation * * +------------+-------------------------+----------------------------------+ * + Date ! Name and Call ! Modification ! * +------------+-------------------------+----------------------------------+ * ! 11.03.2004 ! W.Brunken DF7BE ! first creation ! * +------------+-------------------------+----------------------------------+ * * Compiling: * * gcc secs.c -o secs.exe (DJGPP) * gcc secs.c -o secs (UNIX,LINUX) * cc secs.c -o secs (UNIX) * MICROSOFT QUICK C 2.5 : use Make Menu * set at Options model to "small" */ /* Dieses banale Programm gibt die Sekunden aus, die seit dem 1.1.1970 00:00 Uhr UTC verstrichen sind. Kalkulator zum Pruefen der Ergebnisse im Internet (Stand Januar 2004): http://dan.drydog.com/unixdatetime.html Hinweis fuer IBM-AIX: vor der Kompilierung die Variable setzen: LIBPATH=/usr/lib export LIBPATH dann wird der LIB-Path im Executable abgespeichert, dass Programm bricht dann nicht ab. */ #include int main() { time_t t; printf("%ld\n", time(&t)); return 0; } /* fuer UNIX genuegt: printf("%d\n", time(&t)); Fuer DOS (QC): printf("%ld\n", time(&t)); */