TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Is Hacker News API returning wrong “time”?

14 pointsby Elect2over 5 years ago
Example:<p>https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21268584 it shows &quot;4 hour ago&quot;(by time I posted this question)<p>API: https:&#x2F;&#x2F;hacker-news.firebaseio.com&#x2F;v0&#x2F;item&#x2F;21268584.json unix time:1571218522, and it is 3 days ago.

5 comments

dangover 5 years ago
<a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=false&amp;query=by%3Adang%20timestamps&amp;sort=byDate&amp;type=comment" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?dateRange=all&amp;page=0&amp;prefix=false&amp;qu...</a>
minimaxirover 5 years ago
The way moderator post repromoting via the second-chance pool works will cause such a discrepancy in the API.<p>It is not ideal.
评论 #21299071 未加载
Elect2over 5 years ago
Recently developing a tool and I found this happed very common.<p>You can see <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21268584" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21268584</a> is &quot;5 hours ago&quot;, but from my tool(<a href="https:&#x2F;&#x2F;hn.okphp.com&#x2F;?k=digital,postgres" rel="nofollow">https:&#x2F;&#x2F;hn.okphp.com&#x2F;?k=digital,postgres</a> ) it is &quot;3 days ago&quot;(my tool is using official api timestamp)
评论 #21298892 未加载
yamrzouover 5 years ago
I dont understand why the item page shows “5 hours ago”, but if you filter by domain : <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;from?site=sivers.org" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;from?site=sivers.org</a>, the same item is labeled “3 days ago”, so the API is rather correct. Maybe the timestamp shown on the item page is incorrect, or that the url was re-submitted?
评论 #21298848 未加载
weinzierlover 5 years ago
I noticed that when one of my posts is resubmitted (via second-chance pool) it seems to appear with the time of the resubmit and not the time I posted it originally. I observed this on the website, I never checked the API and maybe this is unrelated to the original question from above. It may even be intentional but probably not many posters know about it.