RE: [PHP] Formatting a MYSQL time

2002-02-07 Thread Kevin Stone
Ah.. much appreciated. :) > -Original Message- > From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] On Behalf Of Lars Torben > Wilson > Sent: Thursday, February 07, 2002 12:43 PM > To: Kevin Stone > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] Formatting a MYSQL time

RE: [PHP] Formatting a MYSQL time

2002-02-07 Thread Lars Torben Wilson
On Thu, 2002-02-07 at 10:47, Kevin Stone wrote: > Unless the $eventdate coming being pulled from your database a bonified > Unix timestamp the date() function will not work. > > I don't like MySQL functions so I've always used $timestamp = mktime() > to create the timestamp. Then plug that value

RE: [PHP] Formatting a MYSQL time

2002-02-07 Thread Kevin Stone
Unless the $eventdate coming being pulled from your database a bonified Unix timestamp the date() function will not work. I don't like MySQL functions so I've always used $timestamp = mktime() to create the timestamp. Then plug that value into a field defined as INT(14). Use $eventdate = date("

Re: [PHP] Formatting a MYSQL time

2002-02-07 Thread Mark
I would let mysql do the work: select *,date_format(dateofevent,"%H:%i %p") as date_formatted from table... - Mark On Thu, 07 Feb 2002 11:21:13 -0600, Frank Miller wrote: >Hello, > > Since I'm the only one who uses php at work I run >into a >little problem and was hoping maybe someone c

Re: [PHP] Formatting a MYSQL time

2002-02-07 Thread Jim Lucas [php]
well, from what you show here you are trying to use a MYSQL timestamp format string in a UNIX Timestamp String. what you need to do is add add this to your select statement. SELECT UNIX_TIMESTAMP() From Table; you want to convert the MYSQL timestamp into a UNIX timestamp. then just through tha

Re: [PHP] Formatting a MYSQL time

2002-02-07 Thread Miles Thompson
Here Frank, play with this you'll have to add a bit of code to select your time values, but it will start you down the road. I spent some time playing with this a couple of years ago, this is taken from a file with the grand name of "junk.php"! Miles Thompson // up here there's code to co