Package com.thortech.xl.util.adapters
Class tcUtilDateOperations
java.lang.Object
com.thortech.xl.util.adapters.tcUtilDateOperations
This class that has basic date operations utility methods. Author:
Solomon Niyazov January 28, 2002. updated by Stanislav Sadykov on July
12, 2002 updated by Stanislav Sadykov on January 24, 2003
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new tcUtilDateOperations object.tcUtilDateOperations
(Date obj) Constructor uses existing Date -
Method Summary
Modifier and TypeMethodDescriptionstatic Date
addDaysToCurrentDate
(int pnNumOfDays) Adds a specifed number of days to the current datestatic long
method returns current date based on System.currentTimeMillis().getDate()
return DateReturns the Day Of the MonthgetHours()
Returns the Hors from the dateint
Returns the Day of the Monthint
Returns the Hours from the Dateint
Returns Minutes from the Dateint
Returns the Month of the yearint
Returns Seconds from the Dateint
Returns the YearReturns Minutes from the DategetMonth()
Returns the Month of the YearReturns Seconds from the DateReturns the Date as Stringlong
getTime()
Returns the date in the long formatReturns the date as Octal StringReturns the Date in Long Format as String typegetYear()
Returns the Yearstatic String
parseCurrentTimeWithFormat
(String format) method returns current date based on the specified format.static String
parseCurrentTimeWithFormatAndTimeZone
(String format, String timeZone) method returns current date based on the specified format and timezone.
-
Constructor Details
-
tcUtilDateOperations
public tcUtilDateOperations()Creates a new tcUtilDateOperations object. -
tcUtilDateOperations
Constructor uses existing Date- Parameters:
obj
-
-
-
Method Details
-
addDaysToCurrentDate
Adds a specifed number of days to the current date- Parameters:
pnNumOfDays
- number of days to be added to the current date- Returns:
- the result date after addition
-
getDate
return Date- Returns:
- Date
-
getTime
public long getTime()Returns the date in the long format- Returns:
- long Date
-
getTimeLongAsString
Returns the Date in Long Format as String type- Returns:
- Long date as String
-
getTimeAsOctalString
Returns the date as Octal String- Returns:
- String
-
getString
Returns the Date as String- Returns:
- Date as String
-
getIntDayOfMonth
public int getIntDayOfMonth()Returns the Day of the Month- Returns:
- Int Day of Month
-
getDayOfMonth
Returns the Day Of the Month- Returns:
- Day of month as a String
-
getIntMonth
public int getIntMonth()Returns the Month of the year- Returns:
- Returns Month Number
-
getMonth
Returns the Month of the Year- Returns:
- No of Month as String
-
getIntYear
public int getIntYear()Returns the Year- Returns:
- Year
-
getYear
Returns the Year- Returns:
- Year as a String
-
getIntHours
public int getIntHours()Returns the Hours from the Date- Returns:
- Hours as Int
-
getHours
Returns the Hors from the date- Returns:
- hours as String
-
getIntMinutes
public int getIntMinutes()Returns Minutes from the Date- Returns:
- Months from the Date
-
getMinutes
Returns Minutes from the Date- Returns:
- Months from the Date
-
getIntSeconds
public int getIntSeconds()Returns Seconds from the Date- Returns:
- Seconds from the Date
-
getSeconds
Returns Seconds from the Date- Returns:
- Seconds from the Date
-
getCurrentDate
public static long getCurrentDate()method returns current date based on System.currentTimeMillis().- Returns:
- System.currentTimeMillis().
-
parseCurrentTimeWithFormat
method returns current date based on the specified format.- Parameters:
format
- for formatting the date- Returns:
- date as String based on the specified format
-
parseCurrentTimeWithFormatAndTimeZone
method returns current date based on the specified format and timezone.- Parameters:
format
- Format in which date is to be formattedtimeZone
- TimeZone to be used- Returns:
- date as String based on the specified format and timezone
-