Hi
I need to know how many Wednesday and Friday exists between two dates. Any help?
Thank you
How many Wednesday and Friday
Moderator: General Moderators
-
mariolopes
- Forum Contributor
- Posts: 102
- Joined: Sun May 22, 2005 7:08 am
Re: How many Wednesday and Friday
What have you tried? What do you have now?
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: How many Wednesday and Friday
I think you can work out for yourself how to do it.
Useful building blocks include:
mktime() turns a date/time into a Unix timestamp
date() can return all sorts of useful information about a timestamp, including the day of the week.
Unix timestamps represent the number of seconds since 1 Jan 1970. Subtracting one timestamp from another gives you the number of seconds between two dates. Dividing this difference by (60*60*24) gives you the number of days; dividing by (60*60*24*7) gives you the number of weeks.
Over to you.
Useful building blocks include:
mktime() turns a date/time into a Unix timestamp
date() can return all sorts of useful information about a timestamp, including the day of the week.
Unix timestamps represent the number of seconds since 1 Jan 1970. Subtracting one timestamp from another gives you the number of seconds between two dates. Dividing this difference by (60*60*24) gives you the number of days; dividing by (60*60*24*7) gives you the number of weeks.
Over to you.