473,216 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

please help with mktime/daylight savings

Hi all, sorry to post yet another unix timestamp question, but I've been
looking through php.net and google and can't find exactly what i need...
plus I think my brain has shut down from too many hours of php code... :-)

Anyways, here is my problem... I am displaying an HTML table that
represents a person's schedule for the week... I query a database and
take the absolute earliest starting time, absolute latest ending time,
and display a table with all times in between (on predetermined
intervals). For example, say my first column represents Monday... right
now what I am doing to get Tuesday's values is multiplying my mktime(0,
0, 0, $month, $day, $year) value for Monday by 86,400 (the number of
seconds in a day). Everything works perfectly fine, except when I come
across the first Sunday in April and the last Sunday in October...

The April Sunday still works fine, but in October, it displays that
Sunday twice. My question is how do I take into account the difference
in hours as a result of daylight savings time? I know I can use "I" as
the format string in date() to see if the date is during daylight
savings or not, and I tried using this to make it work, but it doesn't
seem to be doing what I want.

Thanks so much in advance for any help you can provide.

Marcus

Jul 16 '05 #1
1 2591
Marcus écrivit:
For example, say my first column represents Monday...
right now what I am doing to get Tuesday's values is multiplying my
mktime(0, 0, 0, $month, $day, $year) value for Monday by 86,400 (the
number of seconds in a day). Everything works perfectly fine, except
when I come across the first Sunday in April and the last Sunday in
October...


don't do :
mktime(0, 0, 0, $month, $day, $year) + 86400

do :
mktime(0, 0, 0, $month, $day+1, $year)
--
P'tit Marcel
Jul 16 '05 #2

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

Similar topics

1
by: Adam Monsen | last post by:
Say I have the following datetime object: >>> from datetime import datetime >>> d = datetime(2005, 8, 10, 15, 43) I happen to know this is a local time from the Netherlands, so I assume the...
1
by: KW | last post by:
Hi all, Appreciate if someone can help me out on this. Currently, I have a tm structure holding information of the UTC time, which is very likely to be in the past, meaning not the current...
1
by: Ernie | last post by:
I am creating an .ics file that when opened (via Outlook) inserts a meeting into the calendar. All works fine unless the date and time I'm inserting happens to occur on the hour the time changes...
10
by: Marc Pelletier | last post by:
Hello, I am writing an application that does some simple astronomical calculations. One of the variables I need is the number of hours passed in this year. I've written the following function ...
3
by: chrisdevey | last post by:
Is there any way to make a System.Timers.Timer adjust for daylight savings time change? In a long running process I set a timer as follows for a daily expiration: _myTimer = new...
3
by: Anna | last post by:
Hi, I've already found out that .Net Framework 1.1 does not properly handle anything that is related to a non-current timezone. Since my project should be released before the release of...
1
by: Gil | last post by:
I'm trying to mimic the functionality of netdaysworked in excel. The code below works, except when the date starts during daylight savings time. what is the number of seconds in a day for a...
3
by: Generic Usenet Account | last post by:
Hi, Is there any way to make time-of-day adjustments for daylight savings using only standard time functions? We have a program that executes daily at a fixed time of day. After daylight...
27
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.