Hello,

I often find myself writing `DateTime.truncate(DateTime.utc_now(), 
:second)` or similar stuff to get to the ‘instance’ of now.

What if we have sigils `~U`, `~D`, and `~T` extended to:

~U[now] → DateTime.utc_now()
~T[now] → Time.utc_now()
~D[today] → Date.utc_today() 

with possible modifiers `s` and `m` to truncate times to seconds and 
milliseconds respectively?

~U[now]s → DateTime.truncate(DateTime.utc_now(), :second)

Here is the PR with the code for the reference 
https://github.com/elixir-lang/elixir/pull/10840 (it uses empty sigils 
instead of ~U[now])

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/8dac9f64-d3b1-4753-8564-263604ff6b00n%40googlegroups.com.

Reply via email to