I am trying this cool code to send Push Notification tomorrow at 06:00 pm.
Parse.Cloud.define("tomorrowIn18", function(request, response)
{
var query = new Parse.Query(Parse.Installation);
query.equalTo('installationId', request.installationId);
query.find({
success: function(object){
var inst = object[0];
var timeZone=inst.get("timeZone").toString();
var tomorrow =new Date();
tomorrow.setHours(tomorrow.getHours()+24);
tomorrow.setHours(18+parseInt(timeZone));
tomorrow.setMinutes(0);
Parse.Push.send({
where: query,
data: {
alert: "Your Friends Await you!"
},
push_time: tomorrow
}, {
success: function() {
response.success("done "+tomorrow);
},
error: function(error) {
response.error(error);
}
});
},
error: function(error)
{
response.error(error);
}
});
});
In Push log I see - Aug 24, 00:00 am. But today is Aug 23 so result must be like this - Aug 23 06:00 pm. Where is error? What did I do wrong?