การแปลงวันที่เข้าไปในข้อความในน้ำอมฤต

รหัสตัวอย่าง

3
0

น้ำอมฤตข้อความที่จะเดท

defmodule SomeModule do
  @doc """
      iex> SomeModule.to_date("2020-01-30")
      ~D[2020-01-30]
  """
  def to_date(string), do: Date.from_iso8601!(string)

  @doc """
      iex> SomeModule.to_date_time("1997-07-16T19:20:30.45Z")
      ~U[1997-07-16 19:20:30.45Z]
  """
  def to_date_time(string) do
    case DateTime.from_iso8601(string) do
      {:ok, date_time, _offset} -> date_time
      error -> error
    end
  end
end

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................