customize

You are here

[SOLVED] How To Change Date Format From UTC Timezone To Any Required Timezone

Error message

User error: Failed to connect to memcache server: localhost:11212 in dmemcache_object() (line 415 of /home/freedrup/public_html/demo/d7/sites/all/modules/memcache/dmemcache.inc).

In Drupal, usually the date field value is saved in the database in UTC timezone format. One of our requirements for a project was to show the date in the site's timezone format. So we generated a general function to convert date in UTC timezone to any required timezone and format it.

Just use the below function to convert date in UTC timzone to a given timezone and the format date using a valid timestamp,

Source: 
http://feeds.zyxware.com/~r/zyxware/~3/yls64ySclj4/solved-how-to-format-date-in-utc-timezone-to-any-required-timezone