Category Archives: Php

Convert GMT to Local timezone in PHP

Following code snippet converts a date time in GMT to Local timezone.

 

Composer Warning: openssl extension is missing

While installing Laravel via composer on Wamp server I got this error

You must enable the openssl extension to download files via https

To resolve this issue, go to

c:/wamp/bin/php/{your php version} and open php.ini file. Uncomment the line by removing the semi colon in front of it

extension=php_openssl.dll

restart all service, it should work. Remember do not edit php.ini file from Wamp UI because it edits apache’s php.ini file.

 

PHP Date format

This is my list of useful date formats in PHP for my own reference, I update it whenever I come across to new ones, so that I don’t need to search for it on web.

To get the Day of a date

To get a date in this format

22 April 2013

To get, Jul 18

Adding no of days to a PHP date, In this example we are adding 2 days to a PHP date