Date - roidrole/Roids-Tweaker GitHub Wiki
Provides a way for CT to use Date objects
Contains :
Provides utilities for the IDate interface.
Import :
import mods.ctintegration.date.DateUtil;| Method | Description |
|---|---|
| static IDate now() | gets an IDate instance that indicates the current time |
| static IDate fromTimeInMillis(long timeInMillis) | |
| static IDate parse(String format, String dateString) | format is a SimpleDateFormat, returns null if the format is wrong |
| public static int ERA() | Field type representation |
| public static int YEAR() | Field type representation |
| public static int MONTH() | Field type representation |
| public static int WEEK_OF_YEAR() | Field type representation |
| public static int WEEK_OF_MONTH() | Field type representation |
| public static int DATE() | Field type representation |
| public static int DAY_OF_MONTH() | Field type representation |
| public static int DAY_OF_YEAR() | Field type representation |
| public static int DAY_OF_WEEK() | Field type representation |
| public static int DAY_OF_WEEK_IN_MONTH() | Field type representation |
| public static int AM_PM() | Field type representation |
| public static int HOUR() | Field type representation |
| public static int HOUR_OF_DAY() | Field type representation |
| public static int MINUTE() | Field type representation |
| public static int SECOND() | Field type representation |
| public static int MILLISECOND() | Field type representation |
| public static int ZONE_OFFSET() | |
| public static int DST_OFFSET() | |
| public static int FIELD_COUNT() | |
| public static int SUNDAY() | Used in DAY_OF_WEEK field |
| public static int MONDAY() | Used in DAY_OF_WEEK field |
| public static int TUESDAY() | Used in DAY_OF_WEEK field |
| public static int WEDNESDAY() | Used in DAY_OF_WEEK field |
| public static int THURSDAY() | Used in DAY_OF_WEEK field |
| public static int FRIDAY() | Used in DAY_OF_WEEK field |
| public static int SATURDAY() | Used in DAY_OF_WEEK field |
| public static int JANUARY() | Used in MONTH field |
| public static int FEBRUARY() | Used in MONTH field |
| public static int MARCH() | Used in MONTH field |
| public static int APRIL() | Used in MONTH field |
| public static int MAY() | Used in MONTH field |
| public static int JUNE() | Used in MONTH field |
| public static int JULY() | Used in MONTH field |
| public static int AUGUST() | Used in MONTH field |
| public static int SEPTEMBER() | Used in MONTH field |
| public static int OCTOBER() | Used in MONTH field |
| public static int NOVEMBER() | Used in MONTH field |
| public static int DECEMBER() | Used in MONTH field |
| public static int UNDECIMBER() | Used in MONTH field |
| public static int AM() | Used in AM_PM field |
| public static int PM() | Used in AM_PM field |
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;| 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 |
| 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 |
You can compare two IDate instances with <, >, <=, >=, == and !=.