Skip to content

Commit

Permalink
feat(tsl): add unix timestamp placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoodie committed Oct 4, 2019
1 parent b5e426c commit 947bff4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon=false

mod_id=twitchspawn
mod_group=net.programmer.igoodie
mod_version=0.3.13
mod_version=0.3.14

minecraft_version=1.12.2
forge_version=14.23.3.2655
Expand Down
Expand Up @@ -5,6 +5,7 @@

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
Expand Down Expand Up @@ -81,6 +82,9 @@ public static String fromArgs(String expression, EventArguments args) {
if (expression.equals("time_utc"))
return getDateFormat("HH:mm:ss", TimeZone.getTimeZone("UTC")).format(new Date());

if (expression.equals("unix"))
return String.valueOf(Instant.now().getEpochSecond());

return null;
}

Expand Down

0 comments on commit 947bff4

Please sign in to comment.