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 Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
chaking Posted July 2, 2010 Author Share Posted July 2, 2010 Looks good - thanks for the help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.