fixes #6050 Problems with the datetime field in structures modified

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