Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8076875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:21:21+00:00 2026-06-05T15:21:21+00:00

Using MySQL should I store time data as an Int which would be the

  • 0

Using MySQL should I store time data as an Int which would be the number of milliseconds since midnight, January 1, 1970 UTC or as Timestamp in the database.

I know both have advantages which is the best way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:21:22+00:00Added an answer on June 5, 2026 at 3:21 pm

    Can’t say for sure from standpoint of your PHP code, but storing it in MySQL datetime format opens up all the MySQL date/time functions without having to deal with first converting with FROM_UNIXTIME. Also, timestamps have a limit of the year 2038 – see Why do timestamps have a limit to 2038?

    As the comments say, you can convert either way, so it becomes a question of where do you want the most convenience – in your SQL statements, or PHP code.

    IMHO, times/dates are not just a number – they have special purposes in our use of them, so storing them as just a number is limiting yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to query my MySQL database using prepared statements. The query should look
Using MySQL and php how would I, in a single query, grab all results
I´m using Mysql since quite a while and am really confused by the result
I have an application that stores GMT time data in a MySQL db like
I have a MySQL table containing a column to store time and another to
I am using mySQL from their C API, but that shouldn't be relevant. My
Using MySQL with a very large table (millions of entries), I need to find
USING MySQL. I have two tables. Table A, and Table B. Table A has
Using MySQL query browser, I manually made a table called users and input some
(Using MySQL and PHP) I have a search form that will allow my users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.