Packages
ConfigCat SDK for Elixir. Feature Flags created by developers for developers with ❤️. ConfigCat lets you manage feature flags across frontend, backend, mobile, and desktop apps without (re)deploying code. % rollouts, user targeting, segmentation. Feature toggle SDKs for all main languages.
Current section
Files
Jump to
Current section
Files
lib/config_cat/fetch_time.ex
defmodule ConfigCat.FetchTime do
@moduledoc false
@type t :: non_neg_integer()
@spec now_ms :: t()
def now_ms, do: DateTime.to_unix(DateTime.utc_now(), :millisecond)
@spec to_datetime(t()) :: {:ok, DateTime.t()} | {:error, atom()}
def to_datetime(ms) do
DateTime.from_unix(ms, :millisecond)
end
end