Category: MySQL, api

We think you might be interested in this job:

Laravel / Vue Developer

ComplYant App, Inc

I recently ran into an issue where I was getting integer value timestamp data from an API which I simply saved into an integer column of a table. The client I was working with then decided that they needed to the integer column of timestamps to be converted into human readable DateTime.

After Googling around for quite some time I finally found an answer that worked which I think is worth sharing.

In mysql t able run one of the following queries depending on your use case: You have a 10 digit timestamp value e.g.

Then FLOOR is appliedwhich converts the number to an integer (which is what we need in the next step) by rounding down.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Community Partners