How do I create a DateTime var from a string which is already adjusted for UTC? I am running this on a machine set to BST (GMT+1). If I run the following line of code:
DateTime clientsideProfileSyncStamp = Convert.ToDateTime("20-May-2011 15:20:00");
and then use the value in a test against a database holding (UTC) values then it would appear that the Convert.ToDateTime() is actually giving me a UTC value of 14:20. I don't want it to do the conversion - I just want it to accept that my DateTime string is already in UTC.
Thanks.
Convert.ToDateTime()
, it returned the exact value that the string represents. Are you calling.ToUniversalTime()
? What are you doing with the value after you do the conversion? – Benedikta