i cant check if confing date value and server date value same

Discussion in 'Plugin Development' started by djyee, Jun 28, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    djyee

    hello i cant check if config date value and server date value same its give 0 error but its not working can you help me ?
    here my check codes:

    Config Code:
    Code:
    private File players = new File(getDataFolder(), "players.yml"); 
      public void saveDefaultConfig() {
            if (players == null) {
                players = new File(getDataFolder(), "players.yml");
            }
            if (!players.exists()) {           
                 this.saveResource("players.yml", false);
             }
        }
      public FileConfiguration playersdata = YamlConfiguration.loadConfiguration(players);
    Check Code:
    Code:
     SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
                      String t1  = format.format(now);
                      String t2  = playersdata.getString(p.getUniqueId()+".Date");
                  System.out.println(t2 ==  t1);
                if(t2 ==  t1){
    Config:
    Code:
    837c0579-f2e7-33b1-8682-5e7f8c0c8d23:
      Date: 28.06.2016
      ipaddress: 127.0.0.1
      PlayerName: djyee
    
    i am sorry for my bad English i am still learning English and java
     
  2. Offline

    I Al Istannen

Thread Status:
Not open for further replies.

Share This Page