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 9085357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:13:31+00:00 2026-06-16T21:13:31+00:00

I am in need of a MySQL column that can store a specific date

  • 0

I am in need of a MySQL column that can store a specific date in time. The application I am working with gives me a UNIX timestamp (seconds that have elapsed since January 1, 1970). I need to store this information in the database and retrieve it later in specific ways, see below.

After this date has been stored I need to be able to query the database based on this timestamp. For example, I need to be able to retrieve all rows where the day of the timestamp is the 4th.

So then my question is how do I store this date where it would be easiest to perform the query? DATETIME and TIMESTAMP seem like valid options for me but I can’t seem to figure out how to work the query. I am not looking forward to storing the timestamp as an integer as it wouldn’t allow me to create such a query and I’d have to offload that work to PHP.

If it helps I need to deal with these timestamps in UTC time. I know TIMESTAMP will do the conversion into PST (my local time) for me and so I’d have to do the conversion back to UTC either in MySQL or PHP. (at least I think I would have to)

Please help!

  • 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-16T21:13:32+00:00Added an answer on June 16, 2026 at 9:13 pm

    If I were you, I’ll save those data’s as DateTime. The reasons are

    • the records are readable with our own eye. eg 2013-01-04 00:25:12 is better than 1357259112.
    • you don’t have to use any conversion function like FROM_UNIXTIME to which i think kills the index. So it is much better to use date or datetime because you can utilize index since you can search the value directly by using = or BETWEEN
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to search dates in mysql however, if the column type is date
I need to store set value in MySQL column. I completely like the build-in
I have three columns in mysql table: tax_id, company_name, store_name. I need that tax_id
I need a mysql query which will select all rows that contain joe in
I need a MySql statement that will select all the rows, as well as
I am working with multiple databases in a PHP/MySQL application. I have development, testing,
I am working on a site that has tests users can take. I have
I need to store relative path of a document into a MySQL table. The
We store our blog posts in a text column in our database. We need
I have an issue where I need to AS a column in a MySQL

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.