If strategy receives server time only if is run on LIVE client and in "remote run" mode.
Otherwise
Calendar.getInstance().getTime(); returns time on your machine.
To correctly output time in your location you must change the time zone value in the following line:
setTimeZone(TimeZone.getTimeZone("GMT"));
Basically, you can use this function:
public String dateToStr(long time) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") {
{
setTimeZone(TimeZone.getTimeZone("GMT"));
}
};
return sdf.format(time);
}