Hi,

I want to display current date and time in my system..Therefore i have created following coding.

<?php 
$today= date("F j, Y, g:i a");
echo $today;
?>

This generates time based on GMT..But i want to convert the time to our country's local time which is more than 05:30 hrs.How can i modify the coding?

Recommended Answers

All 2 Replies

Member Avatar for diafol

WHat's your timezone? Find it here: http://www.php.net/manual/en/timezones.php

date_default_timezone_set('Europe/London');

Would be the pattern to use at the top of your page. change the continent/city to a supported pair that suits you.

Yeah, got it..Thanks a lot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.