fixes #5580 Problems with the expire date time field

Fixed the issue and pushed the code for review, please check it.