• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

How change GMT in PHP server?

I have  a different date in my server, i want to set -6 in the server

When i check the time in my server  appears this
[root@php]# date
Fri Apr  8 11:11:31 CST 2011

Then i check the php date with this script

[root@php]# cat hora.php

echo date("r");


When i run the script appears this.

[root@php]# php hora.php
Fri, 08 Apr 2011 12:11:46 -0500

As you can see the time appears -0500, how can i set this time to -0600 ???  
1 Solution
IT_AEAuthor Commented:
I already found the solution, i went to /etc/php.ini and set the timezone here:

; Defines the default timezone used by the date functions
date.timezone = America/El_Salvador
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now