?
Solved

Getting the date in BST

Posted on 2007-08-07
5
Medium Priority
?
578 Views
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)

Thanks
0
Comment
Question by:fox_statton
  • 2
3 Comments
 
LVL 18

Expert Comment

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

Accepted Solution

by:
Eternal_Student earned 1000 total points
ID: 19644472
Here is a script to detect whether we are in BST or GMT:

http://www.devscripts.net/browse/116.php
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 1000 total points
ID: 19644478
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):
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
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…
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
Course of the Month16 days, 9 hours left to enroll

864 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