3 ms·
I'm doing PHP for the first time in years. I needed a function that returns the date of last week's Monday. Turns out PHP has a funky date querying language. I
by tikotus 9mo ago
I'm doing PHP for the first time in years. I needed a function that returns the date of last week's Monday. Turns out PHP has a funky date querying language. I can just do: $today->modify('monday last week'). Makes me happy.
- is_true 9mo agoPHP is always there for you.
- spiderfarmer 9mo agoPHP is just awesome.
- tikotus 9mo agoRight? I don't do much web dev, but now that I do, I don't see why I'd use anything else.
- philo23 9mo agoThe relative date formats are super useful. It can get a bit confusing when there's timezones involved though. https://www.php.net/manual/en/datetime.formats.php#datetime.formats.relative https://www.php.net/manual/en/datetime.formats.php#datetime....
- Aachen 9mo ago[It has been (1) days since the last time that I needed strtotime] Don't know how to do this without PHP, so I actually use it on the shell inline between a bunch of Bash. I assume that's the same function with new syntactic sugar
- dapperdrake 9mo agoIs there a way to cache the parsed query "monday last week" like regexes can be compiled?