public class SQTime
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
longDateFormat
The long date format.
|
static java.lang.String |
shortDateFormat
The short date format.
|
Constructor and Description |
---|
SQTime()
Instantiates a new SQ time.
|
SQTime(java.util.Date date)
Instantiates a new SQ time.
|
SQTime(java.util.Date date,
org.joda.time.DateTimeZone zone)
Instantiates a new SQ time.
|
SQTime(int seconds)
Instantiates a new SQ time.
|
SQTime(int year,
int month,
int day)
Instantiates a new SQ time.
|
SQTime(int year,
int month,
int day,
int hour)
Instantiates a new SQ time.
|
SQTime(int year,
int month,
int day,
int hour,
int minute)
Instantiates a new SQ time.
|
SQTime(int year,
int month,
int day,
int hour,
int minute,
int second)
Instantiates a new SQ time.
|
SQTime(long milis)
Instantiates a new SQ time.
|
SQTime(SQTime dt)
Instantiates a new SQ time.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int field,
int amount)
Adds the.
|
void |
addDays(int day)
Adds the days.
|
SQTime |
addDaysReturnDate(int day)
Adds the days return date.
|
void |
addHours(int hours)
Adds the hours.
|
void |
addMonths(int months)
Adds the months.
|
void |
addWeeks(int weeks)
Adds the weeks.
|
void |
addYears(int year)
Adds the years.
|
SQTime |
clone() |
int |
compareTo(SQTime time)
Compare to.
|
static int |
dowToMetatrader(int dow)
Dow to metatrader.
|
static java.lang.String |
dowToString(int dow)
Dow to string.
|
java.lang.String |
formatDate()
Format date.
|
java.lang.String |
formatDateQuick()
Format date quick.
|
static java.lang.String |
formatDateQuick(int seconds)
Format date quick.
|
static java.lang.String |
formatDateTime(long s)
Format date time.
|
java.lang.String |
formatTime()
Format time.
|
java.lang.Integer |
getDate()
Gets the date.
|
long |
getDateInMs()
Gets the date in ms.
|
java.lang.Integer |
getDateTime()
Gets the date time.
|
int |
getDay()
Gets the day.
|
int |
getDayOfWeek()
Gets the day of week.
|
int |
getDayOfWeekOriginal()
Gets the day of week original.
|
int |
getDayOfYear()
Gets the day of year.
|
static int |
getDaysBetween(org.joda.time.DateTime startDate,
org.joda.time.DateTime endDate)
Gets the days between.
|
static int |
getDaysBetween(long msFrom,
long msTo)
Gets the days between.
|
static int |
getDaysBetween(SQTime startDate,
SQTime endDate)
Gets the days between.
|
int |
getFullYear()
Gets the full year.
|
int |
getHour()
Gets the hour.
|
long |
getMilis()
Gets the milis.
|
int |
getMinute()
Gets the minute.
|
int |
getMonth()
Gets the month.
|
int |
getMonthOriginal()
Gets the month original.
|
static int |
getMonthsBetween(org.joda.time.DateTime startDate,
org.joda.time.DateTime endDate)
Gets the months between.
|
static int |
getMonthsBetween(long msFrom,
long msTo)
Gets the months between.
|
static int |
getMonthsBetween(SQTime startDate,
SQTime endDate)
Gets the months between.
|
int |
getSecond()
Gets the second.
|
int |
getTimeAsTSTime()
Gets the time as ts time.
|
static int |
getTSDiffInMinutes(int time1,
int time2)
Gets the TS diff in minutes.
|
int |
getWeekOfYear()
Gets the week of year.
|
int |
getYear()
Gets the year.
|
static int |
getYear(int seconds)
Gets the year.
|
static int |
getYearsBetween(org.joda.time.DateTime startDate,
org.joda.time.DateTime endDat)
Gets the years between.
|
static int |
getYearsBetween(long msFrom,
long msTo)
Gets the years between.
|
static int |
getYearsBetween(SQTime startDate,
SQTime endDate)
Gets the years between.
|
void |
minus(int field,
int amount)
Minus.
|
void |
parseDateTime(java.lang.String strDateTime)
Parses the date time.
|
void |
parseDateTime(java.lang.String strDateTime,
java.lang.String newDateFormat)
Parses the date time.
|
void |
set(int seconds)
Sets the.
|
void |
set(long millis)
Sets the.
|
void |
setDateFormat(java.lang.String format,
boolean lenient)
Sets the date format.
|
void |
setDayOfMonth(int value)
Sets the day of month.
|
void |
setDayOfWeek(int value)
Sets the day of week.
|
static void |
setDefaultTimeZone()
Sets the default time zone.
|
void |
setHour(int value)
Sets the hour.
|
void |
setMiliS(long miliS)
Sets the mili s.
|
void |
setMinute(int value)
Sets the minute.
|
void |
setSecond(int value)
Sets the second.
|
void |
setTime(int hour,
int minute,
int second)
Sets the time.
|
void |
setTimeToTSTime(int time)
Sets the time to ts time.
|
static boolean |
timesInSameMinute(int time1,
int time2)
Times in same minute.
|
java.util.Date |
toDate()
To date.
|
static java.util.Date |
toDate(int seconds)
To date.
|
java.lang.String |
toDateMinuteString()
To date minute string.
|
static java.lang.String |
toDateMinuteString(int seconds)
To date minute string.
|
static java.lang.String |
toDateMinuteString(long millis)
To date minute string.
|
java.lang.String |
toDateString()
To date string.
|
static java.lang.String |
toDateString(int seconds)
To date string.
|
static java.lang.String |
toDateString(long millis)
To date string.
|
int |
toNumberTime()
To number time.
|
java.lang.String |
toString() |
static java.lang.String |
toString(int seconds)
To string.
|
static java.lang.String |
toString(long millis)
To string.
|
java.lang.String |
toString(java.lang.String dtf)
To string.
|
java.util.Date |
toTime()
To time.
|
static java.lang.String |
toTimeString(int seconds)
To time string.
|
public static java.lang.String shortDateFormat
public static java.lang.String longDateFormat
public SQTime()
public SQTime(java.util.Date date)
date
- the datepublic SQTime(java.util.Date date, org.joda.time.DateTimeZone zone)
date
- the datezone
- the zonepublic SQTime(SQTime dt)
dt
- the dtpublic SQTime(int seconds)
seconds
- the secondspublic SQTime(long milis)
milis
- the milispublic SQTime(int year, int month, int day, int hour, int minute, int second)
year
- the yearmonth
- the monthday
- the dayhour
- the hourminute
- the minutesecond
- the secondpublic SQTime(int year, int month, int day, int hour, int minute)
year
- the yearmonth
- the monthday
- the dayhour
- the hourminute
- the minutepublic SQTime(int year, int month, int day, int hour)
year
- the yearmonth
- the monthday
- the dayhour
- the hourpublic SQTime(int year, int month, int day)
year
- the yearmonth
- the monthday
- the daypublic SQTime clone()
clone
in class java.lang.Object
public void set(int seconds)
seconds
- the secondspublic void set(long millis)
millis
- the millispublic void setMiliS(long miliS)
miliS
- the new mili spublic java.lang.Integer getDateTime()
public java.lang.Integer getDate()
public long getDateInMs()
public int getYear()
public int getFullYear()
public int getMonthOriginal()
public int getMonth()
public int getDayOfWeekOriginal()
public int getDayOfWeek()
public int getDay()
public int getDayOfYear()
public int getWeekOfYear()
public int getHour()
public int getMinute()
public int getSecond()
public void setMinute(int value)
value
- the new minutepublic void setHour(int value)
value
- the new hourpublic void setDayOfWeek(int value)
value
- the new day of weekpublic void setDayOfMonth(int value)
value
- the new day of monthpublic void setSecond(int value)
value
- the new secondpublic void setTime(int hour, int minute, int second)
hour
- the hourminute
- the minutesecond
- the secondpublic void add(int field, int amount)
field
- the fieldamount
- the amountpublic void minus(int field, int amount)
field
- the fieldamount
- the amountpublic void addYears(int year)
year
- the yearpublic void addMonths(int months)
months
- the monthspublic void addWeeks(int weeks)
weeks
- the weekspublic void addDays(int day)
day
- the daypublic void addHours(int hours)
hours
- the hourspublic SQTime addDaysReturnDate(int day)
day
- the daypublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String dtf)
dtf
- the dtfpublic java.lang.String toDateString()
public java.lang.String toDateMinuteString()
public static java.lang.String toString(int seconds)
seconds
- the secondspublic static java.lang.String toString(long millis)
millis
- the millispublic static java.lang.String toDateString(long millis)
millis
- the millispublic static java.lang.String toDateString(int seconds)
seconds
- the secondspublic static java.lang.String toDateMinuteString(int seconds)
seconds
- the secondspublic static java.lang.String toDateMinuteString(long millis)
millis
- the millispublic static java.lang.String toTimeString(int seconds)
seconds
- the secondspublic void setDateFormat(java.lang.String format, boolean lenient)
format
- the formatlenient
- the lenientpublic void parseDateTime(java.lang.String strDateTime) throws java.text.ParseException
strDateTime
- the str date timejava.text.ParseException
- the parse exceptionpublic void parseDateTime(java.lang.String strDateTime, java.lang.String newDateFormat) throws java.text.ParseException
strDateTime
- the str date timenewDateFormat
- the new date formatjava.text.ParseException
- the parse exceptionpublic java.lang.String formatDate()
public java.lang.String formatDateQuick()
public static java.lang.String formatDateQuick(int seconds)
seconds
- the secondspublic java.lang.String formatTime()
public java.util.Date toDate()
public java.util.Date toTime()
public static java.lang.String formatDateTime(long s)
s
- the spublic static java.util.Date toDate(int seconds)
seconds
- the secondspublic static int dowToMetatrader(int dow)
dow
- the dowpublic static java.lang.String dowToString(int dow)
dow
- the dowpublic static boolean timesInSameMinute(int time1, int time2)
time1
- the time1time2
- the time2public static int getYear(int seconds)
seconds
- the secondspublic static int getDaysBetween(long msFrom, long msTo)
msFrom
- the ms frommsTo
- the ms topublic static int getDaysBetween(SQTime startDate, SQTime endDate)
startDate
- the start dateendDate
- the end datepublic static int getDaysBetween(org.joda.time.DateTime startDate, org.joda.time.DateTime endDate)
startDate
- the start dateendDate
- the end datepublic static int getMonthsBetween(long msFrom, long msTo)
msFrom
- the ms frommsTo
- the ms topublic static int getMonthsBetween(SQTime startDate, SQTime endDate)
startDate
- the start dateendDate
- the end datepublic static int getMonthsBetween(org.joda.time.DateTime startDate, org.joda.time.DateTime endDate)
startDate
- the start dateendDate
- the end datepublic static int getYearsBetween(long msFrom, long msTo)
msFrom
- the ms frommsTo
- the ms topublic static int getYearsBetween(SQTime startDate, SQTime endDate)
startDate
- the start dateendDate
- the end datepublic static int getYearsBetween(org.joda.time.DateTime startDate, org.joda.time.DateTime endDat)
startDate
- the start dateendDat
- the end datpublic int toNumberTime()
public static void setDefaultTimeZone()
public int compareTo(SQTime time)
time
- the timepublic long getMilis()
public int getTimeAsTSTime()
public void setTimeToTSTime(int time)
time
- the new time to ts timepublic static int getTSDiffInMinutes(int time1, int time2)
time1
- the time1time2
- the time2