question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pagination of records with datetimes does not include timezone (UTC) Z letter

See original GitHub issue

My DB stores “datetime without timezone”. When I do a query without the pagination librayr and serialize to pydantic models via parse_obj_as, the daettime string generated includes Z at the end. If I use the same query but use paginate(session, query), the paged results do not specify a timezone at the end.

I’m on fastapi-pagination v0.9.1

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
stealthrabbicommented, Dec 21, 2022

OK great this worked, thanks so much. I had to be sure to set the encoder up before I imported anything else with fastapi that defined routes (not simply before creating the FastAPI app instance. I have my routes defined in a separate routes file that had to be considered here.

1reaction
stealthrabbicommented, Dec 21, 2022

Sorry, it is difficult to provide a sanitized example at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does datetime.datetime.utcnow() not contain timezone ...
So, datetime.utcnow() doesn't set tzinfo to indicate that it is UTC, ... I tend to agree that calls to utcnow should include the...
Read more >
Modify date and time formats in Zaps - Zapier Help
Modify date and time formats in Zaps · 1. Add a Formatter step · 2. Customize your date and time options · 3....
Read more >
DateTime | Generic pass - Google Developers
The date/time will be adjusted based on the user's time zone. For example, a time of 2018-06-19T18:30:00-04:00 will be 18:30:00 for a user...
Read more >
Z designator (designating UTC) results in errors #133 - GitHub
This type is unaware of time zones and does not provide a way to access calendar/clock units like month or hour. It's just...
Read more >
Pagination | Cornerstone API
Pagination. The Employee/OU API's GET endpoints segment large results of data into pages. You can control the page size, i.e. the number of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found