[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cistron-radius
Subject:    RE: MySQL and dates
From:       "Handshy, Charles" <CHandsh () citgo ! com>
Date:       1999-04-28 13:40:49
[Download RAW message or body]

You can also do it this way. :)


SELECT name, start_time, stop_time,
(Time() - UNIX_TIMESTAMP(start_time)) as elapsed
FROM usertime WHERE name='bob' and stop_time=0;

It will take the current box time and subtract it from the start time giving
you the current elapsed time of the user.

later
	chuck

-----Original Message-----
From: Ernie Elu [mailto:ernie@spooky.eis.net.au]
Sent: Tuesday, April 27, 1999 3:56 PM
To: cistron-radius@info.cistron.nl
Subject: MySQL and dates


Hi,
can anyone point me in the direction of a perl library that will handle the
date formats used in the stop_time, start_time, and ts fields from the MySQL
databse that the Christian Oyarzuns patch produces. I am having a hell of a
time just subtracting one date from anoter to figure out the seconds
inbetween etc.

The dates look like:


1999-04-26 19:55:39	used in stop_time, start_time

19990426195539		used in ts, partially supported by Date::Manip


- Ernie.

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2410.0">
<TITLE>RE: MySQL and dates</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>You can also do it this way. :)</FONT>
</P>
<BR>

<P><FONT SIZE=2>SELECT name, start_time, stop_time,</FONT>
<BR><FONT SIZE=2>(Time() - UNIX_TIMESTAMP(start_time)) as elapsed</FONT>
<BR><FONT SIZE=2>FROM usertime WHERE name='bob' and stop_time=0;</FONT>
</P>

<P><FONT SIZE=2>It will take the current box time and subtract it from the start time \
giving you the current elapsed time of the user.</FONT> </P>

<P><FONT SIZE=2>later</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>chuck</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Ernie Elu [<A \
HREF="mailto:ernie@spooky.eis.net.au">mailto:ernie@spooky.eis.net.au</A>]</FONT> \
<BR><FONT SIZE=2>Sent: Tuesday, April 27, 1999 3:56 PM</FONT> <BR><FONT SIZE=2>To: \
cistron-radius@info.cistron.nl</FONT> <BR><FONT SIZE=2>Subject: MySQL and \
dates</FONT> </P>
<BR>

<P><FONT SIZE=2>Hi,</FONT>
<BR><FONT SIZE=2>can anyone point me in the direction of a perl library that will \
handle the</FONT> <BR><FONT SIZE=2>date formats used in the stop_time, start_time, \
and ts fields from the MySQL</FONT> <BR><FONT SIZE=2>databse that the Christian \
Oyarzuns patch produces. I am having a hell of a</FONT> <BR><FONT SIZE=2>time just \
subtracting one date from anoter to figure out the seconds</FONT> <BR><FONT \
SIZE=2>inbetween etc.</FONT> </P>

<P><FONT SIZE=2>The dates look like:</FONT>
</P>
<BR>

<P><FONT SIZE=2>1999-04-26 19:55:39&nbsp;&nbsp;&nbsp;&nbsp; used in stop_time, \
start_time</FONT> </P>

<P><FONT SIZE=2>19990426195539&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; used \
in ts, partially supported by Date::Manip</FONT> </P>
<BR>

<P><FONT SIZE=2>- Ernie.</FONT>
</P>

</BODY>
</HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic