|
static void | DateAdd (Calendar date, int intervalKind, int interval) |
|
static void | DateAddInMillis (Calendar date, long millis) |
|
static Calendar | DateValue (String value) |
|
static int | Day (Calendar date) |
|
static long | ConvertDuration (long duration, int intervalKind) |
|
static String | FormatDateTime (Calendar date, String pattern) |
|
static String | FormatDate (Calendar date, String pattern) |
|
static String | FormatTime (Calendar date) |
|
static Calendar | DateInstant (int year, int month, int day) |
|
static Calendar | TimeInstant (int hour, int minute) |
|
static int | Hour (Calendar date) |
|
static int | Minute (Calendar date) |
|
static int | Month (Calendar date) |
|
static String | MonthName (Calendar date) |
|
static Calendar | Now () |
|
static int | Second (Calendar date) |
|
static long | Timer () |
|
static int | Weekday (Calendar date) |
|
static String | WeekdayName (Calendar date) |
|
static int | Year (Calendar date) |
|
Implementation of various date and time related runtime functions.
Definition at line 24 of file Dates.java.
◆ ConvertDuration()
static long com.google.appinventor.components.runtime.util.Dates.ConvertDuration |
( |
long |
duration, |
|
|
int |
intervalKind |
|
) |
| |
|
static |
Returns the give duration in a specified time unit. Months and Years cannot be supported due to their inconsistency.
- Parameters
-
duration | duration to convert time unit |
intervalkind | time unit |
- Returns
- duration converted into a different time unit
Definition at line 174 of file Dates.java.
◆ DateAdd()
static void com.google.appinventor.components.runtime.util.Dates.DateAdd |
( |
Calendar |
date, |
|
|
int |
intervalKind, |
|
|
int |
interval |
|
) |
| |
|
static |
Adds a time interval to the given date. Adding milliseconds has a separated method because interval in ms is long, not int.
- See also
- DateAddInMillis()
- Parameters
-
date | date to add to |
intervalKind | kind of interval |
interval | units to add |
Definition at line 79 of file Dates.java.
◆ DateAddInMillis()
static void com.google.appinventor.components.runtime.util.Dates.DateAddInMillis |
( |
Calendar |
date, |
|
|
long |
millis |
|
) |
| |
|
static |
Adds an interval of milliseconds to the given date. Unlike other time units, milliseconds are saved as long, not int.
- See also
- Dates.DateAdd()
- Parameters
-
date | date to add to |
millis | an interval to add |
Definition at line 106 of file Dates.java.
◆ DateInstant()
static Calendar com.google.appinventor.components.runtime.util.Dates.DateInstant |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day |
|
) |
| |
|
static |
Returns the instant of the given date (used in DatePicker component)
- Parameters
-
year | year of the date |
month | month of the date |
day | day of the date |
- Returns
- Calendar (instant in time)
Definition at line 253 of file Dates.java.
◆ DateValue()
static Calendar com.google.appinventor.components.runtime.util.Dates.DateValue |
( |
String |
value | ) |
|
|
static |
Creates a date from the given string.
Dates must be formatted as follows:
MM/DD/YYYY hh:mm:ss
or
MM/DD/YYYY
or
hh:mm
where MM is the month (01-12), DD the day (01-31), YYYY the year (0000-9999), hh the hours (00-23), mm the minutes (00-59) and ss the seconds (00-59).
- Parameters
-
- Returns
- date
Definition at line 128 of file Dates.java.
◆ Day()
static int com.google.appinventor.components.runtime.util.Dates.Day |
( |
Calendar |
date | ) |
|
|
static |
Returns the day of the month for the given date.
- Parameters
-
- Returns
- day (range 1 - 31)
Definition at line 161 of file Dates.java.
◆ FormatDate()
static String com.google.appinventor.components.runtime.util.Dates.FormatDate |
( |
Calendar |
date, |
|
|
String |
pattern |
|
) |
| |
|
static |
Converts and formats an instant into a string of date with the specified pattern.
- See also
- SimpleDateFormat
- Parameters
-
date | date to format |
pattern | format of the date e.g. MM/DD/YYYY or MMM d, yyyy |
- Returns
- formatted date
Definition at line 221 of file Dates.java.
◆ FormatDateTime()
static String com.google.appinventor.components.runtime.util.Dates.FormatDateTime |
( |
Calendar |
date, |
|
|
String |
pattern |
|
) |
| |
|
static |
Converts and formats an instant into a string of date and time with the specified pattern.
- See also
- SimpleDateFormat
- Parameters
-
date | date to format |
pattern | format of the date and time e.g. MM/dd/YYYY hh:mm:ss a, MMM d, yyyy HH:mm |
- Returns
- formatted date
Definition at line 201 of file Dates.java.
◆ FormatTime()
static String com.google.appinventor.components.runtime.util.Dates.FormatTime |
( |
Calendar |
date | ) |
|
|
static |
Converts and formats the given date into a time string.
- See also
- SimpleDateFormat
- Parameters
-
- Returns
- formatted date
Definition at line 240 of file Dates.java.
◆ Hour()
static int com.google.appinventor.components.runtime.util.Dates.Hour |
( |
Calendar |
date | ) |
|
|
static |
Returns the hours for the given date.
- Parameters
-
- Returns
- hours (range 0 - 23)
Definition at line 294 of file Dates.java.
◆ Minute()
static int com.google.appinventor.components.runtime.util.Dates.Minute |
( |
Calendar |
date | ) |
|
|
static |
Returns the minutes for the given date.
- Parameters
-
date | date to use minutes of |
- Returns
- minutes (range 0 - 59)
Definition at line 305 of file Dates.java.
◆ Month()
static int com.google.appinventor.components.runtime.util.Dates.Month |
( |
Calendar |
date | ) |
|
|
static |
Returns the month of the given date.
- Parameters
-
- Returns
- month: DATE_JANUARY, DATE_FEBRUARY, DATE_MARCH, DATE_APRIL, DATE_MAY, DATE_JUNE, DATE_JULY, DATE_AUGUST, DATE_SEPTEMBER, DATE_OCTOBER, DATE_NOVEMBER, DATE_DECEMBER
Definition at line 321 of file Dates.java.
◆ MonthName()
static String com.google.appinventor.components.runtime.util.Dates.MonthName |
( |
Calendar |
date | ) |
|
|
static |
Returns the name of the month for the given date.
- Parameters
-
- Returns
- name of month
Definition at line 332 of file Dates.java.
◆ Now()
static Calendar com.google.appinventor.components.runtime.util.Dates.Now |
( |
| ) |
|
|
static |
Returns the current date and time.
- Returns
- current date and time
Definition at line 342 of file Dates.java.
◆ Second()
static int com.google.appinventor.components.runtime.util.Dates.Second |
( |
Calendar |
date | ) |
|
|
static |
Returns the seconds for the given date.
- Parameters
-
date | date to use seconds of |
- Returns
- seconds (range 0 - 59)
Definition at line 353 of file Dates.java.
◆ TimeInstant()
static Calendar com.google.appinventor.components.runtime.util.Dates.TimeInstant |
( |
int |
hour, |
|
|
int |
minute |
|
) |
| |
|
static |
Returns the instant of the given time (used in TimePicker component)
- Parameters
-
year | year of the date |
month | month of the date |
day | day of the date |
- Returns
- Calendar (instant in time)
Definition at line 275 of file Dates.java.
◆ Timer()
static long com.google.appinventor.components.runtime.util.Dates.Timer |
( |
| ) |
|
|
static |
Returns the current system time in milliseconds.
- Returns
- current system time in milliseconds
Definition at line 363 of file Dates.java.
◆ Weekday()
static int com.google.appinventor.components.runtime.util.Dates.Weekday |
( |
Calendar |
date | ) |
|
|
static |
◆ WeekdayName()
static String com.google.appinventor.components.runtime.util.Dates.WeekdayName |
( |
Calendar |
date | ) |
|
|
static |
Returns the name of the weekday for the given date.
- Parameters
-
date | date to use weekday of |
- Returns
- name of weekday
Definition at line 388 of file Dates.java.
◆ Year()
static int com.google.appinventor.components.runtime.util.Dates.Year |
( |
Calendar |
date | ) |
|
|
static |
Returns the year of the given date.
- Parameters
-
- Returns
- year
Definition at line 399 of file Dates.java.
◆ DATE_APRIL
final int com.google.appinventor.components.runtime.util.Dates.DATE_APRIL = Calendar.APRIL |
|
static |
◆ DATE_AUGUST
final int com.google.appinventor.components.runtime.util.Dates.DATE_AUGUST = Calendar.AUGUST |
|
static |
◆ DATE_DAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_DAY = Calendar.DATE |
|
static |
◆ DATE_DECEMBER
final int com.google.appinventor.components.runtime.util.Dates.DATE_DECEMBER = Calendar.DECEMBER |
|
static |
◆ DATE_FEBRUARY
final int com.google.appinventor.components.runtime.util.Dates.DATE_FEBRUARY = Calendar.FEBRUARY |
|
static |
◆ DATE_FRIDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_FRIDAY = Calendar.FRIDAY |
|
static |
◆ DATE_HOUR
final int com.google.appinventor.components.runtime.util.Dates.DATE_HOUR = Calendar.HOUR_OF_DAY |
|
static |
◆ DATE_JANUARY
final int com.google.appinventor.components.runtime.util.Dates.DATE_JANUARY = Calendar.JANUARY |
|
static |
◆ DATE_JULY
final int com.google.appinventor.components.runtime.util.Dates.DATE_JULY = Calendar.JULY |
|
static |
◆ DATE_JUNE
final int com.google.appinventor.components.runtime.util.Dates.DATE_JUNE = Calendar.JUNE |
|
static |
◆ DATE_MARCH
final int com.google.appinventor.components.runtime.util.Dates.DATE_MARCH = Calendar.MARCH |
|
static |
◆ DATE_MAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_MAY = Calendar.MAY |
|
static |
◆ DATE_MILLISECOND
final int com.google.appinventor.components.runtime.util.Dates.DATE_MILLISECOND = Calendar.MILLISECOND |
|
static |
◆ DATE_MINUTE
final int com.google.appinventor.components.runtime.util.Dates.DATE_MINUTE = Calendar.MINUTE |
|
static |
◆ DATE_MONDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_MONDAY = Calendar.MONDAY |
|
static |
◆ DATE_MONTH
final int com.google.appinventor.components.runtime.util.Dates.DATE_MONTH = Calendar.MONTH |
|
static |
◆ DATE_NOVEMBER
final int com.google.appinventor.components.runtime.util.Dates.DATE_NOVEMBER = Calendar.NOVEMBER |
|
static |
◆ DATE_OCTOBER
final int com.google.appinventor.components.runtime.util.Dates.DATE_OCTOBER = Calendar.OCTOBER |
|
static |
◆ DATE_SATURDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_SATURDAY = Calendar.SATURDAY |
|
static |
◆ DATE_SECOND
final int com.google.appinventor.components.runtime.util.Dates.DATE_SECOND = Calendar.SECOND |
|
static |
◆ DATE_SEPTEMBER
final int com.google.appinventor.components.runtime.util.Dates.DATE_SEPTEMBER = Calendar.SEPTEMBER |
|
static |
◆ DATE_SUNDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_SUNDAY = Calendar.SUNDAY |
|
static |
◆ DATE_THURSDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_THURSDAY = Calendar.THURSDAY |
|
static |
◆ DATE_TUESDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_TUESDAY = Calendar.TUESDAY |
|
static |
◆ DATE_WEDNESDAY
final int com.google.appinventor.components.runtime.util.Dates.DATE_WEDNESDAY = Calendar.WEDNESDAY |
|
static |
◆ DATE_WEEK
final int com.google.appinventor.components.runtime.util.Dates.DATE_WEEK = Calendar.WEEK_OF_YEAR |
|
static |
◆ DATE_YEAR
final int com.google.appinventor.components.runtime.util.Dates.DATE_YEAR = Calendar.YEAR |
|
static |
Date/time interval kinds.
Definition at line 29 of file Dates.java.
The documentation for this class was generated from the following file:
- C:/Users/Ulli/appinventor-sources/appinventor/components/src/com/google/appinventor/components/runtime/util/Dates.java