Re: RFC Concept: "Import" of simplied string manipulation and other instructions from ASP Classic
| From: | David Rodrigues | Date: | Sat, 25 Sep 2021 20:00:56 +0000 |
| Subject: | Re: RFC Concept: "Import" of simplied string manipulation and other instructions from ASP Classic | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116166@lists.php.net to get a copy of this message | ||
Hello!
Why are the current date() alternatives not working for you?
- is_date() => checkdate(int $month, int $day, int $year) or
DateTime::createFromFormat('Y-m-d', $date) !== false;
- year() => date('Y');
- month() => date('m');
- day() => date('d');
- hour() => date('H');
- minute() => date('i');
- second() => date('s');
- week() => date('W');
I can agree with you that the current ways are a bit confusing for a
beginner. For example, I myself didn't know the representation of weeks
using date() -- I had to search. But I think creating new "root functions"
would be too much. Perhaps a package like Carbon could be very useful. Or
even the DateTime itself.
Atenciosamente,
David Rodrigues
Em sáb., 25 de set. de 2021 às 16:48, Daniele B via internals <
internals@lists.php.net> escreveu:
> Here we go with a list of Date and time functions:
> // Classic Aspfunction is_date(string $date) {}function year(?string
> $date) {}function month(?string $date) {}function day(?string $date)
> {}function hour(?string $date) {}function minute(?string $date) {}function
> second(?string $date) {}function weekday(?string $date) {}
> //other stuff to simplify:function date_add() {}
>
>
>
> -------- Original message --------
> From: Kamil Tekiela <tekiela246@gmail.com>
> Date: 9/25/21 16:49 (GMT+01:00)
> To: daniele bonini <my25mb@aol.com>
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] RFC Concept: "Import" of simplied string
> manipulation and other instructions from ASP Classic
>
> Hi Daniele,
> Thanks for reaching out to internals. I am curious about your proposal.
> Could you please provide some examples of what you think was great in
> Classic ASP that you would like to see implemented in PHP? If you have
> implemented polyfills in PHP for them, could you share them with us?
> Regards,Kamil
>