I've been looking around for a little while for what I thought would be a simple question to answer but I cannot seem to find the answer.
The question is: How can I convert a date with the format
2017-05-27 into a Drupal safe format for saving into the database?
I have looked inside
Drupal\datetime\DateTimeComputed but I'm not sure that is the right place. Any help would be appreciated.