Re: Re: [rgc] displaying tonights performing artist
2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 6, 2014 (RSS)
By s2smedia - March 5, 2014
In response to: [url "http://www.interactivetools.com/forum/forum-posts.php?postNum=2215282#post2215282"]Re: [rgc] displaying tonights performing artist[/url], ...
I have a question regarding this. how do you include time as well as date?
so for example I want to show past events as of March 5 @ 3:00pm?
By gregThomas - March 6, 2014
Hi s2smedia,
You can do this by adding a standard MySQL date time string your where statement. The format for the string should be:
<?php
list($eventRecords, $eventMetaData) = getRecords(array(
'tableName' => 'event',
'where' => " date >= NOW() ",
));
?>
This will send the full current date and time, for example:
2014-03-06 16:57:12
If you wanted to just use the current hour you could use:
<?php
list($eventRecords, $eventMetaData) = getRecords(array(
'tableName' => 'event',
'where' => " date >= '".date('Y-m-d H:00:00')."'",
));
?>
This uses the PHP function date to construct the time stamp, this would send a time stamp in this format:
2014-03-06 16:00:00
Let me know if you have any questions.
Thanks!
Greg
PHP Programmer - interactivetools.com