Open
Description
From my understanding, DateTime.timestamp()
does the same as DateTime.now().toUtc()
. One of my codebases contains a lot of the latter because I did not know that the former existed. In all cases, I actually needed a timestamp and was sometimes worried that I'd forget the toUtc()
.
A quick GitHub code search yielded 12k results for DateTime.now().toUtc()
and in most of those cases DateTime.timestamp()
would be the better alternative.
Is this worth a lint rule? Having this rule would make DateTime.timestamp()
more discoverable for developers, potentially preventing bugs where devs forget a toUtc()
after DateTime.now()
.