Fix bug where timestamp across different dates