Debian Codegraph @

packages/seacas/libraries/supes/ext_lib/exdate.c

raw
1 /*
2 * Copyright(C) 1999-2021 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8 /*
9 */
10
11 /*
12 C DESCRIPTION:
13 C This routine returns the current date in a character string. The
14 C format is as follows:
15
16 C YYYYMMDD
17
18 C MM is a two digit month
19 C DD is a two digit day
20 C YYYY is a four digit year
21
22 C This is known as the "Compact ISO 8601 format"
23
24 C FORMAL PARAMETERS:
25 C STRING CHARACTER String to receive the date
26
27 ************************************************************************
28
29 */
30
31 #define STRLEN 8
32 #include <time.h>
33
34 #if defined(ADDC_)
35 void exdate_(char *string, long int len)
36 #else
37 void exdate(char *string, long int len)
38 #endif
39 {
40 time_t tim = time((time_t *)0);
41 struct tm *t = localtime(&tim);
42 strftime(string, STRLEN + 1, "%Y%m%d", t);
43 }