Comments (3)
@jenna-jordan I just ran a quick test of _correct_knack_timestamp
import datetime
import pytz
timezone = pytz.timezone("America/New_York")
mills_timestamp = -55903046400000
timestamp = mills_timestamp / 1000
dt_utc = datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc)
dt_naive = dt_utc.replace(tzinfo=None)
dt_local = timezone.localize(dt_naive)
No issue, the result looks fine:
datetime.datetime(198, 7, 3, 0, 0, tzinfo=<DstTzInfo 'America/New_York' LMT-1 day, 19:04:00 STD>)
Reading the datetime
docs, this might be a platform-specific issue. Are you running this on Windows?
if the timestamp is out of the range of values supported by the platform C localtime() function, and OSError on localtime() failure. Itβs common for this to be restricted to years from 1970 through 2038.
Here's an SO post with the cross-platform way to handle this. TIL. I'd estimate this as a 1
to patch it. Will be backwards compatible.
I believe we're going to talk internally next week about how our team is going to prioritize these fixes going forward. In the meantime feel free to submit a PR @jenna-jordan.
cc @mateoclarke @frankhereford
from knackpy.
When I was running this in the debugger, I was on a Windows computer. When we run workflows in production, they are run in a docker container running Ubuntu. I will test out to see if the problem occurs using Ubuntu as well.
from knackpy.
Confirmed that it runs fine in the docker container (Ubuntu) - seems the issue is only with Windows.
cc @johnclary
from knackpy.
Related Issues (20)
- Size constraints on knackpy.get() requests? HOT 8
- Downloads Function Documentation HOT 1
- Sanitize file paths when downloading files HOT 1
- Update connected field value HOT 1
- Unexpected behavior when using `Record.format`
- Ability to override default formatters
- Knack formatting for equation type fields is not preserved HOT 4
- Feature Request: add a formatter for user_roles field type
- There is any typo in the Document
- Improve formatting of array values on views
- Issue with get function when Knack fields updated as connection fields HOT 3
- Unable to make filters work HOT 2
- Support changing MAX_ROWS_PER_PAGE HOT 3
- api._continue has a infinite loop bug HOT 7
- Make App._download_files() a static method
- How to fill in knack "connection field" using knackpy
- How to fill in connection field (one to many) from knackpy HOT 2
- TypeError: string indices must be integers HOT 2
- MaxRetries Error while fetching 3.6 lakh records from Knack HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knackpy.