Generate ISO 8601 timestamp into buf. */
| 267 | |
| 268 | /* Generate ISO 8601 timestamp into buf. */ |
| 269 | static void iso_timestamp(char *buf, size_t bufsz) { |
| 270 | time_t now = time(NULL); |
| 271 | struct tm tm; |
| 272 | #ifdef _WIN32 |
| 273 | gmtime_s(&tm, &now); |
| 274 | #else |
| 275 | gmtime_r(&now, &tm); |
| 276 | #endif |
| 277 | (void)strftime(buf, bufsz, "%Y-%m-%dT%H:%M:%SZ", &tm); |
| 278 | } |
| 279 | |
| 280 | /* ── Metadata read/write ─────────────────────────────────────────── */ |
| 281 |