Get hours difference between utc and local time php

Many times we need to get the hours difference between the utc and local time in our application. Below is the code which tells us how many hours we are behind or forward as campared to UTC time.

echo date(‘P’);