Solved

convert date and time to integer

Posted on 2006-11-07
3
437 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

10 Experts available now in Live!

Get 1:1 Help Now