Hi Utku,
here is an example that shows all possible conversions:
void showdate() {
int msg_i;
date znow, manual_date;
znow = now();
printf(format("int date: %d\n", (int)znow));
printf(format("str date: %s\n", (date)znow));
manual_date = (date)"12/16/2016 13:40:26";
manual_date = (int)manual_date + (60 * 60 * 24);
printf(format("manual date: %s\n", (string)manual_date));
send_wait(0, top_object(), "call_attr", "wrkshft", "val_by_key", "sym", "(08:30-17:30)(9x5)", 1, "sched");
printf(format("shifted date: %s\n", (date)workshift_work2abs((string)msg[1], (date)now(), (duration)(60 * 60 * 9))));
}
output:
D:\Scripts\bop>bop_cmd -u sd -f exec.frg showdate()
int date: 1481877626
str date: 12/16/2016 13:40:26
manual date: 12/17/2016 13:40:26
shifted date: 12/19/2016 13:40:26
BONUS:
date tomorrow_morning;
tomorrow_morning = (date)format("%s 08:00:00", substr((string)((date)((int)now() + (int)(24 * 60 * 60))), 0, 10));
printf(format("Tomorrow morning: %s\n", tomorrow_morning));
Regards,
cdtj