Re: Displaying date/time

2010-03-09 Thread Tompkins Neil
- From: Gavin Towey [mailto:gto...@ffn.com] Sent: Friday, March 05, 2010 4:15 PM To: Tompkins Neil; prabhat kumar Cc: [MySQL] Subject: RE: Displaying date/time That's probably something best done in your presentation (app) layer. If you must do this in mysql, then you'll probably want

RE: Displaying date/time

2010-03-08 Thread Price, Randall
: Displaying date/time That's probably something best done in your presentation (app) layer. If you must do this in mysql, then you'll probably want to write a stored function. -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Friday, March 05, 2010 10:27 AM

Re: Displaying date/time

2010-03-08 Thread Tompkins Neil
' ); END Maybe this will help. Thanks, Randall Price Senior Programmer Analyst Virginia Tech -Original Message- From: Gavin Towey [mailto:gto...@ffn.com] Sent: Friday, March 05, 2010 4:15 PM To: Tompkins Neil; prabhat kumar Cc: [MySQL] Subject: RE: Displaying date/time That's

Displaying date/time

2010-03-05 Thread Tompkins Neil
Hi I have a number of rows which have Date and Time data in. I want to display in the following formats based on the systems current time e.g under 1 hour 24min ago e.g under 1 day 16h 29min ago e.g over 1 day 1d 2h 29min ago e.g over 1 week 1w 4d 2h 29min ago How would this best be achieve

Re: Displaying date/time

2010-03-05 Thread prabhat kumar
Might be this will help you: there is a table called message with 3 colums - id, pubdate and message; You can get all messages from the last 5 minutes with the following example; SELECT TIMESTAMPDIFF(MINUTE, pubdate, now()), id, message from message where (TIMESTAMPDIFF(MINUTE, pubdate, now())

Re: Displaying date/time

2010-03-05 Thread Tompkins Neil
Hi That is kind of what I'm looking for. However I'd like to be able to display the difference between date 1 and date 2 like 1d 2h 29min ago Thanks Neil On Fri, Mar 5, 2010 at 3:32 PM, prabhat kumar aim.prab...@gmail.com wrote: Might be this will help you: there is a table called message

RE: Displaying date/time

2010-03-05 Thread Gavin Towey
Cc: [MySQL] Subject: Re: Displaying date/time Hi That is kind of what I'm looking for. However I'd like to be able to display the difference between date 1 and date 2 like 1d 2h 29min ago Thanks Neil On Fri, Mar 5, 2010 at 3:32 PM, prabhat kumar aim.prab...@gmail.com wrote: Might