Monday 22 February 2010

Number 3 of a list of 627 really idiotic things to do with Twitter

"A Twitter user who posted a "joke" bomb threat against a UK airport could be jailed after pleading guilty to sending a menacing message...[he] has already been suspended from work and banned from Robin Hood Airport for life"

The whole story here

What a plonker.

Thursday 4 February 2010

Converting from local to UTC in C#

Its one of thse things that should be easy.
However if you get your DateTime from a database it will be anonymous, i.e. it will not have its kind set.
So, do this:

DateTime ConvertFromLocalToUTC(DateTime localTime)
{
DateTime anon = new DateTime(localTime.Ticks, DateTimeKind.Local);
DateTime dtUTC = anon.ToUniversalTime();
return dtUTC;
}


Oh, and, in other news, happy Imbolc!