[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

proper type for unix time in mysql database

Posted on 2014-01-11
3
Medium Priority
?
302 Views
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
0
Comment
Question by:Luey
  • 2
3 Comments
 
LVL 58

Expert Comment

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

Accepted Solution

by:
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
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
0
 
LVL 111

Expert Comment

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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month18 days, 3 hours left to enroll

831 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