Symfony, Doctrine – Manage user timezone

By default when you use entity field DateTimeType the date is saved in default timezone configured in your php configuration. Sometimes we need to show and manage dates from database in different timezones.

Using code placed below, date in the database will be saved in UTC +00:00 and during every insert/update data, dates will be converted into this timezone. Every time when you will load data from database, dates will be converted into user defined timezone.

How to do this:

Continue reading Symfony, Doctrine – Manage user timezone

[Prestashop] Set the deepest category assigned to the product as the default

To set the deepest category assigned to the product as the default you need to do:

  1.  Open your database (for example by phpMyAdmin)
  2.  I suggest you create backup of your database for safety (export data and structure)
  3. Open SQL tab and perform these queries Continue reading [Prestashop] Set the deepest category assigned to the product as the default