257
Views
1
Comments
Solved
How do you tell the difference between null time (00:00:00) and 12:00 AM?
Question

We have an app that lets the user track their sleep, but we are unable to tell the difference between a null time and 12:00 AM. I understand we can solve this issue by adding a boolean to the database for every time attribute along with logic to set it when the user changes and saves, but I was hoping there was a more elegant way since we have many other apps where the user inputs time. If you have a better workaround, please share because I couldn't find anyone facing the same issue in the forums.

UserImage.jpg
Alexandre Yip
Solution

Hi Matthew Vines,

If you save the field as datetime you will not have that problem, just add the current date when you save the field. The null datetime will be allways 1900-01-01 00:00:00 .

Please find the default values for different Dbs here

https://success.outsystems.com/documentation/11/reference/outsystems_language/data/database_reference/default_values_on_database/

Hope that it helps you

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.