In my database field is by default date.
I think your logic works.Thanks