473,800 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP and daylight saving time

Hi guys,

Is it somehow possible to disable DST in date() function? I am
currently in UTC+1 timezone which has DST enabled but data i am
processing are throughout the year in UTC+1 without DST. So, how can i
disable automatic DST processing of date() function?

Thanks in advance!
Nov 23 '07 #1
7 4951
mk****@gmail.co m wrote:
Hi guys,

Is it somehow possible to disable DST in date() function? I am
currently in UTC+1 timezone which has DST enabled but data i am
processing are throughout the year in UTC+1 without DST. So, how can i
disable automatic DST processing of date() function?

Thanks in advance!
Hi,

Not 100% sure, but isn't this function made for that?
date_default_ti mezone_set()

http://nl2.php.net/manual/en/functio...mezone-set.php

PHP5 and higher only.
Read the usercontributed notes for hints/links to solution in PHP4

Hope that helps.

Regards,
Erwin Moller
Nov 23 '07 #2
Erwin Moller wrote:
mk****@gmail.co m wrote:
>Hi guys,

Is it somehow possible to disable DST in date() function? I am
currently in UTC+1 timezone which has DST enabled but data i am
processing are throughout the year in UTC+1 without DST. So, how can i
disable automatic DST processing of date() function?

Thanks in advance!

Hi,

Not 100% sure, but isn't this function made for that?
date_default_ti mezone_set()
addition: feed it 'Europe/London' for offset 0.
I think. ;-)

Be sure to test before believing me. :P

Erwin
http://nl2.php.net/manual/en/functio...mezone-set.php

PHP5 and higher only.
Read the usercontributed notes for hints/links to solution in PHP4

Hope that helps.

Regards,
Erwin Moller
Nov 23 '07 #3
On 23 Nov, 12:17, Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
>
addition: feed it 'Europe/London' for offset 0.
I think. ;-)

Be sure to test before believing me. :P
I'm not actually in London but we have daylight savings time in the UK
(only its called 'BST' for British Summer Time to differentiate from
the movable feasts celebrated in other countries ;).

Try using 'GMT' or 'Zulu' or 'UTC'

C.

Nov 23 '07 #4
Erwin Moller wrote:
addition: feed it 'Europe/London' for offset 0.
I think. ;-)
London observes daylight saving.

'UTC' might be better.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17:39.]

It'll be in the Last Place You Look
http://tobyinkster.co.uk/blog/2007/11/21/no2id/
Nov 23 '07 #5
mk****@gmail.co m wrote:
Hi guys,

Is it somehow possible to disable DST in date() function? I am
currently in UTC+1 timezone which has DST enabled but data i am
processing are throughout the year in UTC+1 without DST. So, how can i
disable automatic DST processing of date() function?

Thanks in advance!
What about using gmdate() and adding an hour?
Nov 23 '07 #6
On Fri, 23 Nov 2007 14:09:32 +0100, C. (http://symcbean.blogspot.com/)
<co************ @gmail.comwrote :
On 23 Nov, 12:17, Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
>>
addition: feed it 'Europe/London' for offset 0.
I think. ;-)

Be sure to test before believing me. :P

I'm not actually in London but we have daylight savings time in the UK
(only its called 'BST' for British Summer Time to differentiate from
the movable feasts celebrated in other countries ;).
Well, it's the UK after all. No matter how you adjust your time, seeing
'daylight' is more dependant on the rare absence of clouds :P
--
Rik Wasmus
Nov 23 '07 #7
Rik Wasmus wrote:
Well, it's the UK after all. No matter how you adjust your time, seeing
'daylight' is more dependant on the rare absence of clouds :P
It was nice and sunny for me today. Freezing cold, sure, but clear blue
skies.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 1 day, 12 min.]

It'll be in the Last Place You Look
http://tobyinkster.co.uk/blog/2007/11/21/no2id/
Nov 23 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
5543
by: Amitabh Deepak | last post by:
Is there any way to check whether daylight saving is enabled on a linux machine?
1
30150
by: Drew | last post by:
Is there a way to check if it is daylight savings or not via c#? I have heard you can use System.Globalization? Thanks - Drew
7
4099
by: Brett Edman | last post by:
I created a UTC clock using this: UTCTime = MyTime.ToUniversalTime() Now that we've turned the clocks ahead 1 hour for daylight savings time, the clock is reporting the wrong UTC time. It is reporting UTC + 1 hour. Is this a bug or is there a way I can querey for daylight time and make the adjustment in my application? Thanks.
6
8843
by: Robm | last post by:
Since googling this issue only brings up the April fool's problem, which was solved years ago, I hope that somebody can help me with this. I have a large vc++/mfc application which needs to know when DST is in effect. This has been working fine for years, but I am worried about the upcoming change in 2007 in the US, which will be followed by a number of Canadian provices (where my application is used). The function that I use is very...
0
1515
by: Chirag Shukla | last post by:
Colleagues, I wanted to share a function to find if a date is in Daylight Saving Time or not. I was able to make this function faster than reading MSDN to find functions that .NET provides. I didnt know if .NET was equipped with the new changes President Bush made with respect to Daylight Saving Time increase starting 2007. I could have found out by trying ..NET functions, only if I wasnt a lousy syntax scavanger. Here goes:
1
3226
by: maflatoun | last post by:
Hi everyone, I have 3 different time zones that I'm working with. Basically converting from UTC to those 3 time zones. Eastern Daylight Time (GMT -04:00, New York) Central Daylight Time (GMT -05:00, Chicago) Pacific Daylight Time (GMT -07:00, San Francisco) Using C# I know how to detect if Daylight saving time is applied or not
1
4529
by: maflatoun | last post by:
Hi everyone, I have 3 different time zones that I'm working with. Basically converting from UTC to those 3 time zones. Eastern Daylight Time (GMT -04:00, New York) Central Daylight Time (GMT -05:00, Chicago) Pacific Daylight Time (GMT -07:00, San Francisco) Using C# I know how to detect if Daylight saving time is applied or not
1
2003
by: luke_airig | last post by:
I'm not sure if this is the right group for this posting. If not, please accept my apologies. I have been tasked with identifying and correcting application code that will be affected by the new daylight saving time change that goes into effect 2007/03/11. This is a .Net application with thousands of lines of c#, javascript and html. As I currently understand it, relevant patches will be supplied and applied to the affected web...
3
3979
by: bernhard Hoyler | last post by:
Hi, I would like to determine whether at a certain time point in time the daylight savings time is in effect. This means such a logic should show that today (16-Nov-2007) no daylight savings time (or European summertime) is in effect, but at 1-Aug-2007 it is. Thanks for your help Bernhard Hoyler
27
6915
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to test the time zone offset on a variety of dates to see if it changes. Based on that, I developed the following checkDST() function which, as far as I can tell, should be sufficient. It checks either the date passed to it or the current date with...
0
9555
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10514
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10287
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6826
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5616
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.