proper type for unix time in mysql database

Posted on 2014-01-11
Medium Priority
Last Modified: 2014-01-11
What is the proper way to store unix time in a mysql database.  I have it as int(10) but I am not sure that is right.  Thanks
Question by:Luey
  • 2
LVL 58

Expert Comment

ID: 39773881
int(10) is fine - is there a reason you don't think it is?
LVL 111

Accepted Solution

Ray Paseur earned 2000 total points
ID: 39773927
I recommend either DATETIME or TIMESTAMP, depending on what you're trying to accomplish.  This article explains some of it.  You might want to read the entire article.  The part you're asking about can be found by searching Storing Date and Time in Your Database
LVL 111

Expert Comment

by:Ray Paseur
ID: 39773971
Thanks for the points, and thanks for using EE, ~Ray

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question