Postgresql Insert Datetime Now Format Python Binary Search Algorithm