Changes in src/libcfa/time.c [b6d7f44:10a97adb]
- File:
-
- 1 edited
-
src/libcfa/time.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/time.c
rb6d7f44 r10a97adb 10 10 // Created On : Tue Mar 27 13:33:14 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 6 22:26:00 201813 // Update Count : 3712 // Last Modified On : Thu Apr 12 14:41:00 2018 13 // Update Count : 22 14 14 // 15 15 … … 17 17 #include "iostream" 18 18 #include <stdio.h> // snprintf 19 #include <assert.h>20 19 21 20 static char * nanomsd( long int ns, char * buf ) { // most significant digits … … 88 87 time_t s = tv / TIMEGRAN; 89 88 tm tm; 90 gmtime_r( &s, &tm ); // tm_mon <= 11, tm_mday <= 31 91 #if defined(__GNUC__) && __GNUC__ >= 7 92 #pragma GCC diagnostic push 93 #pragma GCC diagnostic ignored "-Wformat-truncation" 94 #endif 89 gmtime_r( &s, &tm ); 95 90 snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_year % 99, tm.tm_mon + 1, tm.tm_mday ); 96 #if defined(__GNUC__) && __GNUC__ >= 797 #pragma GCC diagnostic pop98 #endif99 91 return buf; 100 92 } // yy_mm_dd … … 103 95 time_t s = tv / TIMEGRAN; 104 96 tm tm; 105 gmtime_r( &s, &tm ); // tm_mon <= 11, tm_mday <= 31 106 #if defined(__GNUC__) && __GNUC__ >= 7 107 #pragma GCC diagnostic push 108 #pragma GCC diagnostic ignored "-Wformat-truncation" 109 #endif 97 gmtime_r( &s, &tm ); 110 98 snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mon + 1, tm.tm_mday, tm.tm_year % 99 ); 111 #if defined(__GNUC__) && __GNUC__ >= 7112 #pragma GCC diagnostic pop113 #endif114 99 return buf; 115 100 } // mm_dd_yy … … 118 103 time_t s = tv / TIMEGRAN; 119 104 tm tm; 120 gmtime_r( &s, &tm ); // tm_mon <= 11, tm_mday <= 31 121 #if defined(__GNUC__) && __GNUC__ >= 7 122 #pragma GCC diagnostic push 123 #pragma GCC diagnostic ignored "-Wformat-truncation" 124 #endif 105 gmtime_r( &s, &tm ); 125 106 snprintf( buf, 9, "%02d/%02d/%02d", tm.tm_mday, tm.tm_mon + 1, tm.tm_year % 99 ); 126 #if defined(__GNUC__) && __GNUC__ >= 7127 #pragma GCC diagnostic pop128 #endif129 107 return buf; 130 108 } // dd_mm_yy
Note:
See TracChangeset
for help on using the changeset viewer.