[+] Create Date.format()
This commit is contained in:
@@ -28,3 +28,9 @@ class ActiveList : JavaPlugin(), CommandExecutor
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Date.format(f: String = "yyyy-MM-dd"): String
|
||||||
|
{
|
||||||
|
val date = this.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
|
||||||
|
return date.format(DateTimeFormatter.ofPattern(f))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user