Skip to content
TCreopargh edited this page Jan 10, 2021 · 6 revisions

IDate is an interface that allows access to system time and date formatting.

You can get an instance of IDate from DateUtil.

IDate is internally implemented with java.util.Calendar.

Importing class

import mods.ctintegration.date.IDate;

Getters and Setters

Zen Getter Return Type Zen Setter Setter argument Description
timeInMillis long timeInMillis long get/set the total milliseconds has passed since 1/1/1970
year int year int
month int month int
day int day int
dayInWeek int dayInWeek int
hour int hour int Time in day, 1day = 24 hours
minute int minute int
second int second int
milliSecond int milliSecond int

Methods

Method Description
int getField(int field) Field representations can be retrieved from DateUtil
void setField(int field, int value)
String toString() Formats the date with yyyy-MM-dd HH:mm:ss
String format(String formatString) For how to format the date, see this

Operators

You can compare two IDate instances with <, >, <=, >=, == and !=.

Clone this wiki locally