recordtime format

fmejia 02 Mar, 2009
Good day, I have a quick question that I was unable to find an answer for in the forum, is it possible that you can tell me how to do it or where I can find my answer?

I did my form and used ChronoConnectivity to display the information and it all works perfect now, except for the fact that I need to show only the records stored in "today's date", and I am totally unable to do it using the WHERE SQL option, that's because the "recordtime" field automatically stored with my form has date and time on it, is there a way to store this date without the time? or any other way to get the records with ChronoConnectivity even if the field has the time?

Sorry I am really slow at this and totally a newbie ... I hope I made myself clear 😶
GreyHead 02 Mar, 2009
Hi fmejia,

Try
WHERE DATE('recordtime') = CURDATE();


Bob
fmejia 02 Mar, 2009
that gave me an error but I change the field type in the database table to DATE and now it stores only the date, so I used WHERE recordtime = CURDATE() and it works just fine.. thank you very much🙂
fmejia 05 Mar, 2009
good day it's me again, I have been looking for this trough the forums for 3 days already but I didn't find it, I also found how to do it in PHP using DATE FORMAT() and DATE () but they all give me errors, when I put the code in my connectivity I am sure I am missing something in the syntaxis can someone help me to format the field "recordtime" that is saved in this format (2009-03-02 21:12:00) to display it in this format (03-02-2009) in my chronoconnectivity? thank you for your help.. 🙂
Max_admin 06 Mar, 2009
Hi,

use strtotime function to convert this time to a unix timestamp then use the date function to show it in your format!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 07 Mar, 2009
Hi fmejia,

It will be something like
date('d-m-Y', strtotime({recordtime}));

Bob
This topic is locked and no more replies can be posted.