In my form I have selecting date with datetimepicker which i'm using only date picker.
I need to get the selected date value to do some calculation in php through ajax.
Here is my code but the result shows date starting 01/01/1970 !!
public function getmydateHTML() {
$jinput = JFactory::getApplication()->input;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$dt = $jinput->get ('dvalue');
$date = $jinput->get ('selectedate');
$sdt = strtotime($date);
$newdate = strtotime("+$dt day", $sdt);
echo date('d/m/Y', $newdate);
exit;
}
How can I get correct selected date value?
$dt
and$date
only then can we work forward and help resolve this old question. Remember, even if this is no longer an issue for you, this site intends to help future researchers -- please help to progress this page to a resolution.