Skip to content

Instantly share code, notes, and snippets.


Matthew Denson mdenson-dayspring

View GitHub Profile
# -*- coding: utf-8 -*-
# Inspired by Hack-A-Day article
# Author: Matthew Denson <mdenson AT dayspring-tech DOT com>
# Originally written for Processing: Feb 2, 2012
# Rewritten in Python/Tk: Oct 24, 2014
# Copyright (c) 2014 Dayspring Technologies, Inc.
mdenson-dayspring / ClientEnvironmentListener.php
Created Jan 18, 2014
Pieces parts used to retrieve the browser time zone to a Symfony 2.3/Propel web application. By using these pieces you can get and display dates and times in the users timezone and store them in them correctly so that they can be displayed correctly in another users timezone.
View ClientEnvironmentListener.php
namespace MyApp\MyBundle\EventListener;
use DateTimeZone;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\DependencyInjection\ContainerInterface;
class ClientEnvironmentListener {