i am working with windows phone 8 and need to convert a DateTime Object into a unix timestamp.
I know there are lots of posts on how to do that, but I have an odd mistake i just cant figure out.
I am doing this:
double val = (value.Ticks - New DateTime(1970,1,1).Ticks) / TimeSpan.TicksPerSecond;
where value is the DateTime Object i want to convert to a unix timestamp. I know that value contains the right Time, (during debugging i can see it has the right date+time)
but the converted unix value is always +2 hours off. There has to be an issue with time zones.
Can someone help me? I find dealing with timezones very very annoying under WP, because there are no methods to convert to a specific time zone other than UTC or Local.