I am trying to post a date field to the HubSpot contact API, however, I am getting errors stating a UTC date is not midnight.
"1505779200 is at 10:16:19.200 UTC, not midnight!"
However, if you use this tool (https://www.epochconverter.com/), and enter that value you will see that the value is midnight.
The c# code I use to do the conversion is:
public static double DateTimeToUTC(System.DateTime dateTime)
dateTime = System.DateTime.SpecifyKind(dateTime, DateTimeKind.Utc);
var utcValue = ((DateTimeOffset) dateTime).ToUnixTimeSeconds();
Can anyone help?