Connecting Tech Pros Worldwide Help | Site Map

mysql time functions

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 23rd, 2005, 12:05 AM
meltedown
Guest
 
Posts: n/a
Default mysql time functions



This represents 2 fields in a mysql database
[login] => 2005-08-22 18:04:41
[logout] => 2005-08-22 18:05:08

I want to find out the difference between these 2 times.
I don't have access to mysql's DATEDIFF function.

How do I do this ? Its there perhaps, a web page that explains how ?
I have looked at the date and time functions of the mysql manual but i
don't understand it.



  #2  
Old August 23rd, 2005, 12:35 AM
Tim Van Wassenhove
Guest
 
Posts: n/a
Default Re: mysql time functions

On 2005-08-22, meltedown <groups2@reenie.org> wrote:[color=blue]
>
>
> This represents 2 fields in a mysql database
> [login] => 2005-08-22 18:04:41
> [logout] => 2005-08-22 18:05:08
>
> I want to find out the difference between these 2 times.
> I don't have access to mysql's DATEDIFF function.[/color]

You could calculate the difference yourself:

SELECT UNIX_TIMESTAMP(logout) - UNIX_TIMESTAMP(login) AS secondsdif


--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
  #3  
Old August 23rd, 2005, 12:45 AM
meltedown
Guest
 
Posts: n/a
Default Re: mysql time functions

Tim Van Wassenhove wrote:[color=blue]
> On 2005-08-22, meltedown <groups2@reenie.org> wrote:
>[color=green]
>>
>>This represents 2 fields in a mysql database
>>[login] => 2005-08-22 18:04:41
>>[logout] => 2005-08-22 18:05:08
>>
>>I want to find out the difference between these 2 times.
>>I don't have access to mysql's DATEDIFF function.[/color]
>
>
> You could calculate the difference yourself:
>
> SELECT UNIX_TIMESTAMP(logout) - UNIX_TIMESTAMP(login) AS secondsdif
>
>[/color]
Thanks, that works.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.