// ------------------------------------------------------------ */ I needed a way to display an announcement on a shopping site, that would warn users that orders placed between a certain date range, would not be shipped until after a certain date.
I created this simple date detection code to display the notice on certain pages.
I built this function to suffice any datediff needs I had. negative integers are returned * * $split recognizes the following: * 'yw' = splits up years, weeks and days (default) * 'y' = splits up years and days * 'w' = splits up weeks and days * 'd' = total days * * examples: * $dif1 = date Diff() or date Diff('yw') * $dif2 = date Diff('y') * $dif3 = date Diff('w') * $dif4 = date Diff('d') * * assuming date Diff returned 853 days, the above * examples would have a print_r output of: * $dif1 == Array( [y] = I ran into an issue using a function that loops through an array of dates where the keys to the array are the Unix timestamp for midnight for each date.
The loop starts at the first timestamp, then incremented by adding 86400 seconds (ie. However, Daylight Saving Time threw off the accuracy of this loop, since certain days have a duration other than 86400 seconds.
I needed a function that determined the last Sunday of the month.
But I still think how to do it if you can guide me I would appreciate a world, and everything should show without pressing buttons, if I press a button would be like to store in the database only the results otenidos as date1 date2 and result I needed to calculate the week number from a given date and vice versa, where the week starts with a Monday and the first week of a year may begin the year before, if the year begins in the middle of the week (Tue-Sun).
This is the way weekly magazines calculate their issue numbers.
Virus note: All files are scanned once-a-day by Source for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. Re-scan downloaded files using your personal virus checker before using it. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
When debugging code that stores date/time values in a database, you may find yourself wanting to know the date/time that corresponds to a given unix timestamp, or the timestamp for a given date & time.