Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 23rd, 2005, 01: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, 01: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, 01: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

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles