195 // Return current local time in a string (YYYY-MM-DD HH:MM:SS). |
195 // Return current local time in a string (YYYY-MM-DD HH:MM:SS). |
196 // It is MT safe, but not async-safe, as reading time zone |
196 // It is MT safe, but not async-safe, as reading time zone |
197 // information may require a lock on some platforms. |
197 // information may require a lock on some platforms. |
198 static char* local_time_string(char *buf, size_t buflen); |
198 static char* local_time_string(char *buf, size_t buflen); |
199 static struct tm* localtime_pd (const time_t* clock, struct tm* res); |
199 static struct tm* localtime_pd (const time_t* clock, struct tm* res); |
|
200 static struct tm* gmtime_pd (const time_t* clock, struct tm* res); |
200 // Fill in buffer with current local time as an ISO-8601 string. |
201 // Fill in buffer with current local time as an ISO-8601 string. |
201 // E.g., YYYY-MM-DDThh:mm:ss.mmm+zzzz. |
202 // E.g., YYYY-MM-DDThh:mm:ss.mmm+zzzz. |
202 // Returns buffer, or NULL if it failed. |
203 // Returns buffer, or NULL if it failed. |
203 static char* iso8601_time(char* buffer, size_t buffer_length); |
204 static char* iso8601_time(char* buffer, size_t buffer_length, bool utc = false); |
204 |
205 |
205 // Interface for detecting multiprocessor system |
206 // Interface for detecting multiprocessor system |
206 static inline bool is_MP() { |
207 static inline bool is_MP() { |
207 // During bootstrap if _processor_count is not yet initialized |
208 // During bootstrap if _processor_count is not yet initialized |
208 // we claim to be MP as that is safest. If any platform has a |
209 // we claim to be MP as that is safest. If any platform has a |