get timestamp from datetime object