1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU 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, see <http://www.gnu.org/licenses/>. */
18 #include "start-date.h"
23 /* Writes the current date into CUR_DATE in the format DD MMM
26 get_cur_date (char cur_date[12])
28 time_t now = time (NULL);
29 if (now != (time_t) -1)
31 struct tm *tm = localtime (&now);
34 strftime (cur_date, 12, "%d %b %Y", tm);
38 strcpy (cur_date, "?? ??? 2???");
41 /* Returns the date at which PSPP was started, as a string in the
42 format DD MMM YYYY. */
46 static char start_date[12];
47 if (start_date[0] == '\0')
48 get_cur_date (start_date);