| 1 |
/* |
| 2 |
* Copyright(C) 1999-2020, 2022 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 |
************************************************************************ |
| 13 |
|
| 14 |
C DESCRIPTION: |
| 15 |
C This routine returns the current time in a CHARACTER string. The |
| 16 |
C format is as follows: |
| 17 |
|
| 18 |
C HH:MM:SS |
| 19 |
|
| 20 |
C HH is a two digit hour |
| 21 |
C MM is a two digit minute |
| 22 |
C SS is a two digit second |
| 23 |
|
| 24 |
C FORMAL PARAMETERS: |
| 25 |
C STRING CHARACTER String to receive the time |
| 26 |
|
| 27 |
************************************************************************ |
| 28 |
|
| 29 |
*/ |
| 30 |
|
| 31 |
#include <time.h> |
| 32 |
|
| 33 |
#if defined(ADDC_) |
| 34 |
void extime_(char *string, long int len) |
| 35 |
#else |
| 36 |
void extime(char *string, long int len) |
| 37 |
#endif |
| 38 |
{ |
| 39 |
time_t tim = time(0); |
| 40 |
struct tm *t = localtime(&tim); |
| 41 |
strftime(string, 9, "%H:%M:%S", t); |
| 42 |
} |