How to add date in ban

Discussion in 'Spigot Plugin Development' started by xXEmiXx, Jun 8, 2017.

  1. Hi, in my plugin need date in the ban, and i do not know how to do it. Pls help!
     
  2. Is custom the ban
     
  3. Mas

    Mas

    • Like Like x 1
  4. Code (Text):
    Date bandate = new Date();
    ?
     
  5. Then use dateformat (easiest) or
    Code (Text):
            Calendar calendar = GregorianCalendar.getInstance();
            calendar.setTime(date);
            int hours = calendar.get(Calendar.HOUR_OF_DAY);
            int minutes = calendar.get(Calendar.MINUTE);
            int seconds = calendar.get(Calendar.SECOND);
            //etc
    DateFormat example:
    Code (Text):
    String currentDate = new SimpleDateFormat("dd-MM-yyyy").format(System.currentTimeMillis());