You need to sign in to do that
Don't have an account?
PtitFred
How to use Date in WHERE clause ?
Hello, I try to make a request with a filter on the field LastModifiedDate in PHP but I don't know the PHP function to use...
$request = "select Id from Opportunity where LastModifiedDate > ". ? ."";
I read that It had to use gmdate(DATE_ISO8601) but I don't understand how. I'm using php 4.2.3
Thanks !
$request = "select Id from Opportunity where LastModifiedDate > ". ? ."";
I read that It had to use gmdate(DATE_ISO8601) but I don't understand how. I'm using php 4.2.3
Thanks !
gmdate('%Y-%m-%d%TH:%i:%s+0000');
Nte that that will render the current date/time in GMT. If you want to insert a different date, supply it through a second parameter to the function, for example:
gmdate('%Y-%m-%d%TH:%i:%s+0000', strotime('last week'));
I found this and it works :
function get_iso_8601_date($int_date) {
$date_mod = date('Y-m-d\TH:i:s', $int_date);
$pre_timezone = date('O', $int_date);
$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
$date_mod .= $time_zone;
return $date_mod;
}
... where LastModifiedDate > ".get_iso_8601_date(time())." ...
See you soon !