Commit 6d8e9f9
authored
fix: populate timezone data when formatting time (#3203)
The `jv2tm` function was zeroing fields of `struct tm` that were not
specified by the standard. However, depending on the libc this produced
incorrect timezone data when used together with formatting functions.
This change tries to fill the timezone data using either `mktime`,
`timegm`, or manually.
Apple's Libc implementation contains a bug which causes it to ignore
the offset data present in the `struct tm` in favor of the older heuristic
needed by legacy standards. This workaround temporarily sets the global
timezone so it gets picked up during formatting.1 parent b86ff49 commit 6d8e9f9
2 files changed
+58
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1594 | 1594 | | |
1595 | 1595 | | |
1596 | 1596 | | |
1597 | | - | |
| 1597 | + | |
1598 | 1598 | | |
1599 | 1599 | | |
1600 | 1600 | | |
| |||
1624 | 1624 | | |
1625 | 1625 | | |
1626 | 1626 | | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1630 | 1641 | | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
1634 | 1646 | | |
1635 | 1647 | | |
1636 | 1648 | | |
| |||
1642 | 1654 | | |
1643 | 1655 | | |
1644 | 1656 | | |
1645 | | - | |
| 1657 | + | |
1646 | 1658 | | |
1647 | 1659 | | |
1648 | 1660 | | |
| |||
1740 | 1752 | | |
1741 | 1753 | | |
1742 | 1754 | | |
1743 | | - | |
| 1755 | + | |
1744 | 1756 | | |
1745 | 1757 | | |
1746 | 1758 | | |
1747 | 1759 | | |
1748 | 1760 | | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1749 | 1768 | | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
1750 | 1776 | | |
1751 | 1777 | | |
1752 | 1778 | | |
| |||
1771 | 1797 | | |
1772 | 1798 | | |
1773 | 1799 | | |
1774 | | - | |
| 1800 | + | |
1775 | 1801 | | |
1776 | 1802 | | |
1777 | 1803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
697 | 719 | | |
0 commit comments