Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert timezone

Posted on 2001-07-26
2
Medium Priority
?
1,179 Views
Last Modified: 2008-02-26
My server is somewhere in a timezone of GMT-7. Must be somewhere on the level of Arizona, I guess.

I want to convert the time and date of the server into Eastern Australia Standard Time (GMT+10).

Are there any PHP scripts out there that I could use? I tried the php manual, but all the talk about timestamps and gmtdates was too much for me. gmtdate() seems to help me to convert the time into GMT, but that's not what I want.

Anybody can help?
0
Comment
Question by:andreas_boehmer
2 Comments
 
LVL 1

Accepted Solution

by:
tripat earned 200 total points
ID: 6325546
For any Date in reqd time zone I generally use following technique:

<?
$current_date = date("Y-m-d H:i:s",
mktime(date("H")+17,date("i"),date("s"),date("m"),date("d"),date("Y")));
echo $current_date;
?>

Hope this helps,

Tripat


0
 

Author Comment

by:andreas_boehmer
ID: 6325606
Thanks Tripat, exactly what I needed.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question