nette / utils

🛠 Lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
https://doc.nette.org/utils
Other
1.98k stars 147 forks source link

DateTime: Add shortcut now(). #256

Closed janbarasek closed 3 years ago

janbarasek commented 3 years ago

Just feature for most common shortcut.

dg commented 3 years ago

How is this different from new DateTime?

janbarasek commented 3 years ago

The method is not magical because it expresses exactly what will be returned (evidence base practice). You can also override the method in your own implementation and, for example, handle time zones differently.

dg commented 3 years ago

It is an unnecessary duplication of known functionality.