ensure to store datetime as long, not Date object