This has been suggested in the past. For example
The main reason why there is not a bang variant is because the `offset` information would be dropped.
On Wednesday, June 19, 2019 at 10:13:39 AM UTC+2, Andrea Leopardi wrote:
> I can't see a reason why not to add this. I think a PR would be welcome!
>
>
>
>
>
> Andrea Leopardi
>
an.le...@gmail.com
>
>
>
> On Mon, Jun 17, 2019 at 4:31 PM Mário Guimarães <
mario.lui...@gmail.com> wrote:
>
> The proposed function could be implemented like this
>
>
>
>
> def from_iso8601!(string, calendar \\ Calendar.ISO) do
> case DateTime.from_iso8601(string, calendar) do
> {:ok, datetime, offset} ->
> {datetime, offset}
>
> {:error, reason} ->
> raise ArgumentError,
> "cannot convert #{string} to datetime, reason: #{inspect(reason)}"
> end
> end
>
>
>
>
> segunda-feira, 17 de Junho de 2019 às 15:18:29 UTC+1, Mário Guimarães escreveu:
> Hello,
>
>
> all "from_x" functions in DateTime support their throw exception version, but the function "from_iso8601/2" which returns an error tuple.
>
>
> Doesn't it make sense, because of convenience and completeness, to provide a bang version of this function?
>
>
> See
https://hexdocs.pm/elixir/DateTime.html#from_iso8601/2
>
>
> Thanks
> Mário
>
>
>
>
> --
>
> 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