Solved

convert timezone

Posted on 2001-07-26
2
1,149 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 50 total points
Comment Utility
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
Comment Utility
Thanks Tripat, exactly what I needed.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now