home73k/lib/home73k_web/views/feed_view.ex

12 lines
252 B
Elixir
Raw Permalink Normal View History

2021-04-06 18:13:57 -04:00
defmodule Home73kWeb.FeedView do
use Home73kWeb, :view
import Home73k, only: [app_time_zone: 0]
def to_rfc822(naive_dt) do
naive_dt
|> DateTime.from_naive!(app_time_zone())
|> Calendar.strftime("%a, %d %b %Y %H:%M:%S %Z")
end
end