to_json converts to UTC when encoding ISO formatted datetimes (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Code Sample
In [99]: ts = Timestamp('2013-01-10 00:00:00-0500', tz='US/Eastern')
In [100]: pd.io.json.dumps(ts, iso_dates=True)
Out[100]: '"2013-01-10T05:00:00.000Z"'
Expected Output
In [100]: pd.io.json.dumps(ts, iso_dates=True)
Out[100]: '"2013-01-10T00:00:00.000-05:00"'
cf
In [109]: ts.isoformat()
Out[109]: '2013-01-10T00:00:00-05:00'
Metadata
Metadata
Labels
Development
No branches or pull requests