Need help with 'date' => $_REQUEST['date'] .'+ INTERVAL 12 HOUR',

2 posts by 1 authors in: Forums > CMS Builder
Last Post: October 14, 2016   (RSS)

By Zicky - October 14, 2016 - edited: October 14, 2016

I need to add 12 hours to a date field entry.

I've tried the code below, but it doesn't work

'date'            => $_REQUEST['date'] .'+ INTERVAL 12 HOUR',

OR a more preferred solution would be to add the 'date' and 'event_time' fields into one total combined field that equals the 'date'

'date'    =>  $_REQUEST['date'] ADD $_REQUEST['event_time'] = 'date',

Can someone shed some light on how to get these two lines of code to work.

Thanks, Zick

By Zicky - October 14, 2016

I got this to work using the following combine... if anyone else needs help with a solution such as this.

Zicky

$eventPost_date = $_REQUEST['date'];
$eventPost_time = $_REQUEST['event_time'];
$combined_date_and_time = $eventPost_date . ' ' . $eventPost_time;

'date'      => $combined_date_and_time,