Solved

convert date and time to integer

Posted on 2006-11-07
3
438 Views
Last Modified: 2008-02-01
hi,

Please assist how can we convert date and time value to integer?



Thanks
0
Comment
Question by:FrankPorter
3 Comments
 
LVL 14

Assisted Solution

by:mherchl
mherchl earned 50 total points
ID: 17890643
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

can you give an example, what you exactly want to do?

0
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 350 total points
ID: 17890691
If you're trying to get a PHP timestamp, the way to do it is just:

SELECT UNIX_TIMESTAMP(column_name)
FROM the_table;

0
 
LVL 35

Assisted Solution

by:Raynard7
Raynard7 earned 100 total points
ID: 17894937
I'd reccomend that you use UNIX_TIMESTAMP

however you could also use a number yyyymmddhhnnss which would also be an integer (the maths would not be good with it either)
Date_Format(now(), '%Y%m%d%H%i%S')
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Designing the mysql table for a specific set of queries 3 54
Can i Use Godaddy MySQL to my . Net Web Application 1 38
SQL Update Query 23 93
sql statement to select and drop 13 42
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now