chaking Posted July 1, 2010 Share Posted July 1, 2010 I'm working on daylight savings time around the world and the database I'm drawing the information from lists the start of daylight savings time with the month, day, week, hour, minute and second it starts. Initially I thought I could throw that information into mktime() and get the timestamp, however once I started doing it I realized the `week` part screws it all up. mktime is setup as mktime (hour, minute, seconds, month, day, year) So you can't add in the week of the month. So if I have the following information, anyone know how I can get a timestamp?: Month: 11 Day: 0 Week: 1 Hour: 2 Minute: 0 Seconds: 0 Link to comment https://forums.phpfreaks.com/topic/206464-timestamp-based-on-dayweekmonth/ Share on other sites More sharing options...
travo1992 Posted July 1, 2010 Share Posted July 1, 2010 Cant you just set the days to weeks*7 + days? Link to comment https://forums.phpfreaks.com/topic/206464-timestamp-based-on-dayweekmonth/#findComment-1080005 Share on other sites More sharing options...
chaking Posted July 2, 2010 Author Share Posted July 2, 2010 hmm... good idea, however I don't know if that would work... e.g. take this record: Month: 3 Day: 0 Week: 5 Timezone: Azores Daylight Savings Time I believe this references the last sunday in March... if we were to do (5*7)+0 = 35th day of March? Link to comment https://forums.phpfreaks.com/topic/206464-timestamp-based-on-dayweekmonth/#findComment-1080012 Share on other sites More sharing options...
travo1992 Posted July 2, 2010 Share Posted July 2, 2010 Sorry I wasnt really thinking, week 1 = 0 days, so try (weeks-1)*7+days Link to comment https://forums.phpfreaks.com/topic/206464-timestamp-based-on-dayweekmonth/#findComment-1080121 Share on other sites More sharing options...
chaking Posted July 2, 2010 Author Share Posted July 2, 2010 wow yeah - I should have thought of that too - I'll have to check if that matches up consistently tomorrow. Thanks for the follow up Link to comment https://forums.phpfreaks.com/topic/206464-timestamp-based-on-dayweekmonth/#findComment-1080135 Share on other sites More sharing options...
chaking Posted July 2, 2010 Author Share Posted July 2, 2010 Looks good - thanks for the help Link to comment https://forums.phpfreaks.com/topic/206464-timestamp-based-on-dayweekmonth/#findComment-1080464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.