1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #include "start-date.h"
25 /* Writes the current date into CUR_DATE in the format DD MMM
28 get_cur_date (char cur_date[12])
30 time_t now = time (NULL);
31 if (now != (time_t) -1)
33 struct tm *tm = localtime (&now);
36 strftime (cur_date, 12, "%d %b %Y", tm);
40 strcpy (cur_date, "?? ??? 2???");
43 /* Returns the date at which PSPP was started, as a string in the
44 format DD MMM YYYY. */
48 static char start_date[12];
49 if (start_date[0] == '\0')
50 get_cur_date (start_date);