MCPcopy Create free account
hub / github.com/SuperElastix/elastix / GetCurrentDate

Function GetCurrentDate

Testing/itkTestHelper.h:150–168  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Get current date, format is m-d-y

Source from the content-addressed store, hash-verified

148//------------------------------------------------------------------------------
149// Get current date, format is m-d-y
150const std::string
151GetCurrentDate()
152{
153 time_t now = time(0);
154 struct tm tstruct;
155 char buf[80];
156
157#if !defined(_WIN32) || defined(__CYGWIN__)
158 tstruct = *localtime(&now);
159#else
160 localtime_s(&tstruct, &now);
161#endif
162
163 // Visit http://www.cplusplus.com/reference/clibrary/ctime/strftime/
164 // for more information about date/time format
165 strftime(buf, sizeof(buf), "%m-%d-%y", &tstruct);
166
167 return buf;
168}
169
170
171//------------------------------------------------------------------------------

Callers 1

GetLogFileNameFunction · 0.85

Calls 1

timeClass · 0.85

Tested by

no test coverage detected