Solved

convert date and time to integer

Posted on 2006-11-07
3
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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