php - how to get the server time zone
-
how do i get the srver time zone exept of the date("e") function i need somthing that will check the os time zone and not depends on the php ini and stuff like that... thanks!!! edit 1 i need this becouse i need to know the mysql time zone if i run a query for select global_time_zone i got the result "system" and i need a result like "amrica/new york"
-
Answer:
If you're on *nix, call the system's date using http://www.php.net/manual/en/function.popen.php: popen("date +%Z");
dvdx at Stack Overflow Visit the source
Other answers
If you're using a Linux/Unix based hosting platform, you could use the output of the date command with the "alphabetic time zone abbreviation" formatter as such: $systemTimeZone = system('date +%Z'); However, it should be noted that you shouldn't necessarily rely on the system's timezone and that you should instead use http://www.php.net/manual/en/function.date-default-timezone-set.php (or the date.timezone php.ini setting) to set the required timezone.
middaparka
Related Q & A:
- How do I change the time zone setting on my yahoo page?Best solution by answers.yahoo.com
- How do I change the time zone on My Yahoo!?Best solution by Yahoo! Answers
- How do you change the time zone on My yahoo page?Best solution by Yahoo! Answers
- How do you know what time zone you are in?Best solution by wiki.answers.com
- How to change my Yahoo time zone?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.