-Welcome page API design?

HelipadNew Memberregistered: 2011-02-02 19: PostsWeb site

Hello

Working with the graph API for business page in PHP, what's the best way to convert hours to usable?

JSON output now looks like this:

I believe these are the number of seconds since a specific point on the server, but how can I make these usable times?

Thank you.

Dburns_ Moderator but do _register: 2008-02-09 Posts: 6346

I haven't seen this before, but I guess those seconds offset into week (maybe from midnight Sunday?).  If you divide them by time at 3600.  If you know the times true then you can work with it.

HelipadNew Memberregistered: 2011-02-02 19: PostsWeb site

You can sort of understand.

So if two 9 am (0900) is 406800, and then zero time is Wednesday back at 4 pm (1600).

I'm still not sure how that can be converted to a usable format?

Dburns_ Moderator but do _register: 2008-02-09 Posts: 6346

Yes, Wednesday at 4: 00 p.m. start point definitely bizarre.  I can't explain it, but it seems to work for others (eg. for "thu_1_open": 61200 be 9 am Thursday).

It is similar to the standard Unix times, despite the fact that the standard Unix times are the number of seconds since January 1, 1970.  There are plenty of tools that work with it, but it depends on your language.  See http://php.net/manual/en/function.date.php for PHP, for example.

HelipadNew Memberregistered: 2011-02-02 19: PostsWeb site

I think the starting point of what I give.

If someone is curious, I got the time I wanted to do something like:

HelipadNew Memberregistered: 2011-02-02 19: PostsWeb site

Only to contribute his talents, is already improving my script to iterate between hours to return a formatted list. If you have any suggestions for how to change order of II timezone, opens Wednesday (for shops that close for lunch), I will be grateful.

Meanwhile, my code is:

Which returns:

Dburns_ Moderator but do _register: 2008-02-09 Postsafirstenberg6346: registerednew Member: 2011-06-09 Posts: 5

It looks like a Unix Epoch Times are times.  "Wednesday 4 pm" is the day and time of the start of the Unix time zone.

Yes, Wednesday at 4: 00 p.m. start point definitely bizarre.  I can't explain it, but it seems to work for others (eg. for "thu_1_open": 61200 be 9 am Thursday).

It is similar to the standard Unix times, despite the fact that the standard Unix times are the number of seconds since January 1, 1970.  There are plenty of tools that work with it, but it depends on your language.  See http://php.net/manual/en/function.date.php for PHP, for example.

HelipadNew Memberregistered: 2011-02-02 19: PostsWeb site

Only to provide additional information to those who might be interested, the Graph of Facebook API now includes the time for all possible opening hours, so you may need to adjust your code to reflect this. Now is the example: