A small tip for dates

I had a ton of trouble with dates as a data type. Our app uses a Google Calendar API which gets confused if the date is formatted other than a text. But if I need to recall that date in the app somewhere and pull it from the database, its basically impossible to convert from a text back to a date.

Solution: when saving a date, save it in BOTH formats (make another field). So when we save a date, it is saved as a text and a date type. This allows us to use and recall whichever one we need at the time.

2 Likes