compute_bin: fix date and time handling