Commit 8fc28ed
feat: convert timestamps to ISO 8601 format in Redis
Convert Unix timestamps to ISO 8601 format when writing homepage activity
data to Redis. This provides a consistent, web-standard timestamp format
across the application stack and simplifies frontend timestamp handling.
**Changes:**
- Add `unix_to_iso()` helper to convert Unix timestamps to ISO strings
- Add `convert_timestamps_to_iso()` to process score data lists
- Convert `score_time` and `time` fields to ISO format before Redis write
- Use UTC timezone for all conversions
**Benefits:**
- Web standard format (ISO 8601) throughout the stack
- Human-readable timestamps in Redis for debugging
- Eliminates frontend timestamp conversion logic
- Better compatibility with JavaScript Date API
- Semantic HTML5 `<time>` elements can use datetime directly
**Example:**
- Before: `"time": 1705200000` (Unix integer)
- After: `"time": "2024-01-14T02:40:00+00:00"` (ISO 8601 string)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 1b20212 commit 8fc28ed
1 file changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
19 | 37 | | |
20 | 38 | | |
21 | 39 | | |
| |||
407 | 425 | | |
408 | 426 | | |
409 | 427 | | |
410 | | - | |
| 428 | + | |
| 429 | + | |
411 | 430 | | |
412 | 431 | | |
413 | 432 | | |
| |||
418 | 437 | | |
419 | 438 | | |
420 | 439 | | |
| 440 | + | |
| 441 | + | |
421 | 442 | | |
422 | 443 | | |
423 | 444 | | |
| |||
428 | 449 | | |
429 | 450 | | |
430 | 451 | | |
431 | | - | |
| 452 | + | |
| 453 | + | |
432 | 454 | | |
433 | 455 | | |
434 | 456 | | |
| |||
440 | 462 | | |
441 | 463 | | |
442 | 464 | | |
| 465 | + | |
| 466 | + | |
443 | 467 | | |
444 | 468 | | |
445 | 469 | | |
| |||
0 commit comments