Saturday, October 17, 2015

Facebook page feed time issue

I was implementing facebook page feed for one of my client, the feeds were appearing correct but time was different, actually it was a timezone issue, you have to convert facebook time to local timezone, and to do this i found the perfect way.

step1.
Download and include the js file into your script.

https://gist.github.com/aredo/4153245

step2:

use below code to determine the client timezone:

<script type="text/javascript">
    jQuery(document).ready(function() {
       var timezone = jstz.determine();
var timezonename = timezone.name();  
    });
</script>

No comments:

Post a Comment