I am building a package that heavily relies on the current week number of the year as well as the forthcoming 4 or 5 week numbers. I know that sounds kind of confusing but lets say this week amounts to the 51st one of the year. The next 4 week numbers would be:
- 52
- 1
- 2
- 3
My Question:
How reliable is PHP's date()
function? The library isn't very well documented and the comments underneath make me a little nervous about using it. I am using the following to get the current week number:
echo $weekNumber = date("W");
Is that a reliable way of working with dates? Any recommendations? I am not very good with dates and times and the sheer size of the various functions available in PHP's native library has left me very confused (time()
, strtotime()
, date()
etc).