How to convert a date into a usable date string that takes into account the timezone so that you can use it with the API

How to convert a date into a usable date string that takes into account the timezone so that you can use it with the API

When you provide a date to the API to get records based on that date, be sure to convert the date used in the search criteria to a specific timezone. Using UTC is a good idea. Something that has worked for others is to convert the date to a String and then adjust to UTC.