datetime question

Jun 17, 2009 at 4:27 PM


            facebookevent fa = new facebookevent();
            DateTime startdate = new DateTime(2009, 6, 16, 10, 30, 0,DateTimeKind.Local);

            DateTime enddate = new DateTime(2009, 6, 17, 11, 30, 0, DateTimeKind.Local);
            fa.creator = API.uid;
            fa.description = "W2DTest";
   = "w2Dtest";
            fa.location = "ergens";
   = "w2dtest";
            fa.start_date = startdate;
            fa.start_time = 10;
            fa.end_date = enddate;
            fa.end_time = 11;
            fa.event_type = "Party";
            fa.event_subtype = "Benefit";
            long stat=; 
fa.start_date.ToString() returns 1/1/1970 1:00:10 AM in stead of 17/06/2009 etc.
I've tried to set the DateTimeKind on utc, unspecified,... doesn't help.
What do i need to do to make my facebookevent understand that we're past ABBA music?
I have the feeling that it's something obvious, but I'm missing it.


Jun 17, 2009 at 7:03 PM

This looks like a bug.  Let me take a look.  Doesn't seem that the end_date is being passed through at all.


Jun 17, 2009 at 7:25 PM

I see the issue.  Don't set the end_time and start_time.  Just set the start_date and end_date.  start_date and end_date are helper properties that we added for you.  But when you are setting the end_time after setting the end_date you are overwriting.


So, if you just remove the code for setting the start_time and end_time and just include the time in the date you set in start_date and end_date it should work.  Let me know if you end up with a timezone issue as I was just reading something that leads me to believe you might.

Jun 18, 2009 at 7:30 AM

Yep, worked.

There's idd a timezone problem, it seems like it converts everything to CDT (which is from my Western European point of view -7).

Is there a fix for this problem as well, or should I handle the timezone logic myself?

thanks for the quick response

Jun 18, 2009 at 2:52 PM

I'll take a look at the timezone issue and see if I can correct it.  Will let you know.