Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
event time in /2/open_events
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Reichner  
View profile  
 More options Dec 1 2011, 11:01 pm
From: Michael Reichner <coolg...@gmail.com>
Date: Thu, 1 Dec 2011 20:01:57 -0800 (PST)
Local: Thurs, Dec 1 2011 11:01 pm
Subject: event time in /2/open_events
Hello -

I'm having a little trouble understanding how the time field in /2/
open_events responses corresponds to the event time displayed on event
pages.  Here are five examples from a pull earlier today.

id                      time            utc_offset              Displayed time
--------------------------------------------------------------------------- ----------
qqfjqyppbgc     16:00   -28800          16:00
41512512                07:30   +7200           17:30
39423092                18:30   -28800          18:30
39365812                10:30   0                       18:30
qzrpgcyqdbmb    00:00   +36000          18:00

Can somebody please explain this, and how to calculate displayed time
from time/utc_offset?

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Hamblen  
View profile  
 More options Dec 2 2011, 11:21 am
From: Nathan Hamblen <nath...@meetup.com>
Date: Fri, 02 Dec 2011 11:21:30 -0500
Local: Fri, Dec 2 2011 11:21 am
Subject: Re: event time in /2/open_events
Hi Michael,

The easiest way to explain it is with code samples. What programming
language are you working in?

Nathan

On 12/01/2011 11:01 PM, Michael Reichner wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Reichner  
View profile  
 More options Dec 2 2011, 12:25 pm
From: Michael Reichner <coolg...@gmail.com>
Date: Fri, 2 Dec 2011 09:25:43 -0800 (PST)
Local: Fri, Dec 2 2011 12:25 pm
Subject: Re: event time in /2/open_events
Thanks, Nathan.

I'm working in PHP

On Dec 2, 11:21 am, Nathan Hamblen <nath...@meetup.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Hamblen  
View profile  
 More options Dec 2 2011, 5:24 pm
From: Nathan Hamblen <nath...@meetup.com>
Date: Fri, 02 Dec 2011 17:24:00 -0500
Subject: Re: event time in /2/open_events
We've heard about some problems where the user's php environment could
not work with 64 bit integers, causing it to overflow when converting
from json. So that's the first thing to look out for, whether you have
the full long int.

When you have that, you can divide it by 1000 to get seconds, then pass
it to date($format, $timestamp) which gives you the actual time of the
event, adjusted to your local time zone. If you look at your watch at
that time, the event is starting wherever it is.

But if you're displaying dates and times to a user that you assume will
be in the timezone of the event (as the Meetup site itself does), you
want to adjust the time with the offset. Add the offset to the time
event time before doing anything else to it.

At that point the date will print correctly if your local time is utc.
Generally, it isn't, so you need to do something like this:
http://www.php.net/manual/en/function.date.php#93154

(If date_default_timezone_set() is a global change then that code has
race conditions; there are probably better ways.)

Sorry I don't know php well enough to provide a real code example, but I
hope this gets you off in the right direction.

Nathan

On 12/02/2011 12:25 PM, Michael Reichner wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Reichner  
View profile  
 More options Dec 2 2011, 9:33 pm
From: Michael Reichner <coolg...@gmail.com>
Date: Fri, 2 Dec 2011 18:33:52 -0800 (PST)
Local: Fri, Dec 2 2011 9:33 pm
Subject: Re: event time in /2/open_events
Setting my timezone to UTC did the trick.

Thanks again, Nathan

On Dec 2, 5:24 pm, Nathan Hamblen <nath...@meetup.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Boloramji  
View profile  
 More options Dec 5 2011, 7:43 pm
From: Boloramji <r...@demandpoint.com>
Date: Mon, 5 Dec 2011 16:43:40 -0800 (PST)
Local: Mon, Dec 5 2011 7:43 pm
Subject: Re: event time in /2/open_events
being a newbee to this java script world, it took me a while to
understand this time millseconds!
if you had added one line explanation what about  this  long number
represent in your API page that would be great.
 "Time  in milliseconds elapsed from midnight of January 1, 1970
expressed in UTC time zone"
if you want to convert this time to local time add the utc_offset in
milliseconds.

For example, if you are using C# assuming jo is your json object for
the event, tMeetDate is the meetup time in local time zone. This is
how you will convert
      long lTime = jo["time"];
      long lOffsetTime = jo["utc_offset"];
      lTime /= 1000;
      lOffsetTime /= 1000;
      DateTime tMeetDate = new DateTime(1970,1,1);
      tMeetDate = tMeetDate.AddSeconds(lTime);
      TimeSpan tsOffset = new TimeSpan(0, 0, (int)lOffsetTime);
      tMeetDate = tMeetDate.AddSeconds(lOffsetTime);

On Dec 2, 6:33 pm, Michael Reichner <coolg...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dominique  
View profile  
 More options Nov 16 2012, 8:31 pm
From: Dominique <saltyf...@gmail.com>
Date: Fri, 16 Nov 2012 17:31:50 -0800 (PST)
Local: Fri, Nov 16 2012 8:31 pm
Subject: Re: event time in /2/open_events

If you are having problems dealing with the time due to the large size you
can leave it as a string, strip off the last three characters to convert to
seconds, then use it as an integer and you should be good to go. Using it
as an integer before removing the milliseconds may cause problems in some
environments.


Dominique

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doug Tangren  
View profile  
 More options Nov 16 2012, 10:28 pm
From: Doug Tangren <d...@meetup.com>
Date: Fri, 16 Nov 2012 22:28:26 -0500
Local: Fri, Nov 16 2012 10:28 pm
Subject: Re: event time in /2/open_events

Doug Tangren
Meetup <http://meetup.com>
API Team

Most if not all dates returned by the api are represented in this format.
We usually list time with a description like "UTC creation time of the
event, in milliseconds since the epoch" The issue of dealing with a 64 bit
integer in platforms that only support 32 bit numbers comes up often enough
that we should have a special note in the docs. I'll look into adding this.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »