Getting the date in BST

Posted on 2007-08-07
Last Modified: 2012-08-13
Hi guys,
in PHP i create a date/time using GMDATE(), does anyone know of how I can get the time/date in BST (British Summer Time)

Question by:fox_statton
    LVL 18

    Expert Comment

    A lot of hosting companies will leave the servers on GMT to keep international clients happy. You can use the time() function.
    LVL 18

    Accepted Solution

    Here is a script to detect whether we are in BST or GMT:
    LVL 51

    Assisted Solution

    gmdate() return UTC (aka GMT aka Greenwich Mean Time),
    If you want your local time then use date()

    If you need to calculate absolute times based on any timezone your need to do it yourself. For example if your system returns UTC and you want GMT-1, then call it like:

      gmdate("your format", time()-(60*60));

    IIRC, PHP itself cannot do it (as usual):

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    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…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    728 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

    22 Experts available now in Live!

    Get 1:1 Help Now