Skip to content

Conversation

@minrk
Copy link
Member

@minrk minrk commented May 27, 2015

datetime objects are allowed, and serialized to ISO8601

closes jupyter-widgets/ipywidgets#35

datetime objects are allowed, and serialized to ISO8601
@rgbkrk
Copy link
Member

rgbkrk commented May 27, 2015

Looks good.

rgbkrk added a commit that referenced this pull request May 27, 2015
handle datetime in json_clean
@rgbkrk rgbkrk merged commit 097bc45 into ipython:master May 27, 2015
@jasongrout
Copy link
Member

By the way, IIRC, there is a difference between how python and how browsers handle local vs. UTC. If I remember correctly, we were having issues where python converted things to UTC, and the browser assumed it was local time, or vice versa, if the timezone offset wasn't explicitly specified. There's a whole can of worms there.

@rgbkrk
Copy link
Member

rgbkrk commented May 27, 2015

I love time zones.

@takluyver
Copy link
Member

Looking at the contents service code, I think we're leaving it up to code that creates datetimes to ensure they're 'timezone aware', and then .isoformat() will do the right thing. Python makes it annoyingly difficult to produce timezone-aware datetimes, though.

@minrk minrk deleted the datetime branch May 27, 2015 17:36
@minrk minrk added this to the 4.0 milestone Feb 25, 2016
GRcharles added a commit to GRcharles/ipykernel that referenced this pull request Dec 14, 2022
format dates as ISO8601 - currently works for datetimes, but not dates.

Follow up to ipython#18
blink1073 pushed a commit that referenced this pull request Dec 14, 2022
* format dates as ISO8601

format dates as ISO8601 - currently works for datetimes, but not dates.

Follow up to #18

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_jsonutil.py

* Update jsonutil.py

* Update test_jsonutil.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_jsonutil.py

* fix date test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output widget fails: can't clean datetime for JSON

4 participants