Scratch für Java

Stage::getDaysSince2000()

Gibt die Anzahl der Tage seit dem 01.01.2000 zurück.

Beispiele

import org.openpatch.scratch.*;
 
public class StageGetCurrentTime {
  public StageGetCurrentTime() {
    Stage myStage = new Stage(600, 240);
 
    while (myStage.getTimer().forMillis(3000)) {
      int year = myStage.getCurrentYear();
      int month = myStage.getCurrentMonth();
      int day = myStage.getCurrentDay();
      int weekday = myStage.getCurrentDayOfWeek();
      int hour = myStage.getCurrentHour();
      int minute = myStage.getCurrentMinute();
      int second = myStage.getCurrentSecond();
      int millisecond = myStage.getCurrentMillisecond();
      int daysSince2000 = myStage.getDaysSince2000();
      myStage.display(
          hour
              + ":"
              + minute
              + ":"
              + second
              + ":"
              + millisecond
              + " "
              + year
              + "-"
              + month
              + "-"
              + day
              + " ("
              + weekday
              + ")"
              + " "
              + daysSince2000);
    }
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new StageGetCurrentTime();
  }
}
 

Auf GitHub anschauen

Syntax

Java

.getDaysSince2000()

Scratch

(days since 2000)

Rückgabe

int

getDaysSince2000()