Forum
Calc Builder Support
Calc Builder supportForums
No se permite escribir sin estar logado. Por favor, login
Use 'hour' in JDate 27.09.2017 08:49
Hi,
have been trying to set a delivery date using current hour, because order we receive before 11.00 can be done next day, but after 11.00 I have to add a day extra.
I can not get it to work ... have tried this (and variants)
$date = JFactory::getDate();
$currentTime = new JDate ('now');
if ($currentTime ('H') >=11){
do something ...
} else {do something else}
I do not know how to select the current time from JDate, should be possible I guess?
Hope you can help, have tried searching internet but can't find an answer.
Thanks!
have been trying to set a delivery date using current hour, because order we receive before 11.00 can be done next day, but after 11.00 I have to add a day extra.
I can not get it to work ... have tried this (and variants)
$date = JFactory::getDate();
$currentTime = new JDate ('now');
if ($currentTime ('H') >=11){
do something ...
} else {do something else}
I do not know how to select the current time from JDate, should be possible I guess?
Hope you can help, have tried searching internet but can't find an answer.
Thanks!