Open GoogleCodeExporter opened 8 years ago
I'm in the same boat. Any help would be appreciated. What I found is that the
time of the start and end is 7am. I have lots of events that begin before. So,
the time has to be changed to 00:00:00
Original comment by paulste...@gmail.com
on 1 Sep 2011 at 8:32
This problem is happening because the long values being passed in the query
string are UTC values.
To resolve this we need to reverse the ConvertToTimestamp method. Which will
convert a UTC timestamp into a local datetime and should resolve any issues.
Have tested and I am getting the correct date at 12:00am
Solution:
public void ProcessRequest(HttpContext context)
{
//...
DateTime start = ConvertFromTimeStamp(long.Parse(context.Request.QueryString["start"]));
DateTime end = ConvertFromTimeStamp(long.Parse(context.Request.QueryString["end"]));
//...
}
private DateTime ConvertFromTimeStamp(long timestamp)
{
long ticks = (timestamp * 10000000) + 621355968000000000;
return new DateTime(ticks, DateTimeKind.Utc).ToLocalTime();
}
Original comment by Sean.B.C...@gmail.com
on 22 Apr 2012 at 11:15
Have attached my updated code behind file.
Original comment by Sean.B.C...@gmail.com
on 22 Apr 2012 at 11:20
Attachments:
Original issue reported on code.google.com by
Jonas....@gmail.com
on 7 Apr 2011 at 10:39