I am already storing UTC time in DateTime objects.
When I send this across using Json() serializer these dates are again converted to UTC. I don't want this to happen.
Please help.
tereško
58.5k26 gold badges100 silver badges151 bronze badges
asked Apr 13, 2012 at 9:42
-
Check the Kind property of your DateTime objects, maybe they are not marked as UTC then they get converted again.Adriano Repetti– Adriano Repetti04/13/2012 09:45:32Commented Apr 13, 2012 at 9:45
-
You are right. Please add this as a answer so that I can mark it as correct answerGautam Jain– Gautam Jain04/13/2012 10:20:06Commented Apr 13, 2012 at 10:20
1 Answer 1
Check the Kind
property of your DateTime
objects, maybe they are not marked as UTC then they get converted again.
answered Apr 13, 2012 at 10:40
-
Where is this 'Kind' property? What should it look like?jao– jao09/23/2014 09:48:06Commented Sep 23, 2014 at 9:48
-
1@jao it's a property of
DateTime
objects has, for example:var date = DateTime.Now; Console.WriteLine(date.Kind.ToString());
Adriano Repetti– Adriano Repetti09/23/2014 20:13:40Commented Sep 23, 2014 at 20:13
default