Solved

1-4 week type

Posted on 2013-05-24
2
267 Views
Last Modified: 2013-05-28
PHP
4 different week(date) types
this week is the 21st week of the year: this could be week_type 1
next week: week_type: 2
following week: week_type: 3
final week: week_type:4
week after: week_type:1
0
Comment
Question by:rgb192
2 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39195860
Information about week number is outlined in this article.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

In the PHP date('W') function you can find the ISO week number.  You want to use the ISO number because it is a standard.  The PHP modulus operator can be used to compute the remainder.  The remainder will be zero through three.  If you want to renumber this one through four, add one to the modulus.  See the % operator.
0
 

Author Closing Comment

by:rgb192
ID: 39203081
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Calculate values in an array 18 33
PHP_POST() error message 9 41
Should I use subdomains or addon domains? 3 33
only allow numbers with preg match 4 25
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now