Skip to content

Commit

Permalink
Replaced deprecated time units (1.8.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aely0 authored and Kraigie committed Jan 26, 2019
1 parent cc063b4 commit eae02ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/nostrum/struct/snowflake.ex
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ defmodule Nostrum.Struct.Snowflake do
def from_datetime(%DateTime{} = datetime) do
use Bitwise

unix_time_ms = DateTime.to_unix(datetime, :milliseconds)
unix_time_ms = DateTime.to_unix(datetime, :millisecond)
discord_time_ms = unix_time_ms - Constants.discord_epoch()

if discord_time_ms >= 0 do
Expand Down Expand Up @@ -164,7 +164,7 @@ defmodule Nostrum.Struct.Snowflake do

time_elapsed_ms = (snowflake >>> 22) + Constants.discord_epoch()

{:ok, datetime} = DateTime.from_unix(time_elapsed_ms, :milliseconds)
{:ok, datetime} = DateTime.from_unix(time_elapsed_ms, :millisecond)
datetime
end
end
2 changes: 1 addition & 1 deletion lib/nostrum/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ defmodule Nostrum.Util do
@spec now() :: integer
def now do
DateTime.utc_now()
|> DateTime.to_unix(:milliseconds)
|> DateTime.to_unix(:millisecond)
end

@doc """
Expand Down

0 comments on commit eae02ce

Please # to comment.