Class: LocalDateTime

LocalDateTime()

new LocalDateTime()

Represents an instance of a date
Do not call constructor directly
Instances of LocalDateTime are created using the static DateTime class
Source:
See:

Methods

compareTo(the) → {integer}

Compare this datetime instance to the date in argument
Parameters:
Name Type Description
the LocalDateTime date to be compared to
Source:
Returns:
negative if less, positive if greater, 0 if they are equal
Type
integer

dayOfMonth() → {integer}

Gets the day of the month.
Source:
Returns:
Returns the day-of-month.
Type
integer

dayOfWeek() → {integer}

Gets the day of the week.
Source:
Returns:
Returns the day of the week.
Type
integer

dayOfYear() → {integer}

Gets the day of the year.
Source:
Returns:
Returns the day of the year.
Type
integer

format(the) → {string}

Format this datetime instance
Parameters:
Name Type Description
the string format to use
Source:
Returns:
a formatted date string
Type
string

hour() → {integer}

Gets the hour of the day.
Source:
Returns:
Returns the hour of the day.
Type
integer

isAfter(the) → {boolean}

Check if this datetime instance is after the date in argument
Parameters:
Name Type Description
the LocalDateTime date to be compared to
Source:
Returns:
true if this datetime instance is after the datetime in argument
Type
boolean

isBefore(the) → {boolean}

Check if this datetime instance is before the date in argument
Parameters:
Name Type Description
the LocalDateTime date to be compared to
Source:
Returns:
true if this datetime instance is before the datetime in argument
Type
boolean

isEqual(the) → {boolean}

Check if this datetime instance is equal to the date in argument
Parameters:
Name Type Description
the LocalDateTime date to be compared to
Source:
Returns:
true if this datetime instance is equal to the datetime in argument
Type
boolean

minusDays(number) → {LocalDateTime}

Subtracting a number of days from this Date instance
Parameters:
Name Type Description
number integer of days to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of days.
Type
LocalDateTime

minusHours(number) → {LocalDateTime}

Subtracting a number of hours from this Date instance
Parameters:
Name Type Description
number integer of hours to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of hours.
Type
LocalDateTime

minusMinutes(number) → {LocalDateTime}

Subtracting a number of minutes from this Date instance
Parameters:
Name Type Description
number integer of minutes to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of minutes.
Type
LocalDateTime

minusMonths(number) → {LocalDateTime}

Subtracting a number of months from this Date instance
Parameters:
Name Type Description
number integer of months to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of months.
Type
LocalDateTime

minusNanos(number) → {LocalDateTime}

Subtracting a number of nanoSeconds from this Date instance
Parameters:
Name Type Description
number integer of nanoSeconds to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of nanoseconds.
Type
LocalDateTime

minusSeconds(number) → {LocalDateTime}

Subtracting a number of seconds from this Date instance
Parameters:
Name Type Description
number integer of seconds to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of seconds.
Type
LocalDateTime

minusWeeks(number) → {LocalDateTime}

Subtracting a number of weeks from this Date instance
Parameters:
Name Type Description
number integer of weeks to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of weeks.
Type
LocalDateTime

minusYears(number) → {LocalDateTime}

Subtracting a number of years from this Date instance
Parameters:
Name Type Description
number integer of years to be subtracted
Source:
Returns:
Returns a copy of this datetime minus the specified number of years.
Type
LocalDateTime

minute() → {integer}

Gets the minute of the hour.
Source:
Returns:
Returns the minute of the hour.
Type
integer

month() → {integer}

Gets the month of the year.
Source:
Returns:
Returns the month of the year.
Type
integer

nano() → {integer}

Gets the nano of second.
Source:
Returns:
Returns the nano of second.
Type
integer

plusDays(number) → {LocalDateTime}

Adding a number of days to this Date instance
Parameters:
Name Type Description
number integer of days to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of days.
Type
LocalDateTime

plusHours(number) → {LocalDateTime}

Adding a number of hours to this Date instance
Parameters:
Name Type Description
number integer of hours to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of hours.
Type
LocalDateTime

plusMinutes(number) → {LocalDateTime}

Adding a number of minutes to this Date instance
Parameters:
Name Type Description
number integer of minutes to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of minutes.
Type
LocalDateTime

plusMonths(number) → {LocalDateTime}

Adding a number of months to this Date instance
Parameters:
Name Type Description
number integer of months to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of months.
Type
LocalDateTime

plusNanos(number) → {LocalDateTime}

Adding a number of nanoSeconds to this Date instance
Parameters:
Name Type Description
number integer of nanoSeconds to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of nanoseconds.
Type
LocalDateTime

plusSeconds(number) → {LocalDateTime}

Adding a number of seconds to this Date instance
Parameters:
Name Type Description
number integer of seconds to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of seconds.
Type
LocalDateTime

plusWeeks(number) → {LocalDateTime}

Adding a number of weeks to this Date instance
Parameters:
Name Type Description
number integer of weeks to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of weeks.
Type
LocalDateTime

plusYears(number) → {LocalDateTime}

Adding a number of years to this Date instance
Parameters:
Name Type Description
number integer of years to be added
Source:
Returns:
Returns a copy of this datetime plus the specified number of years.
Type
LocalDateTime

second() → {integer}

Gets the second of the minute.
Source:
Returns:
Returns the second of the minute.
Type
integer

withDayOfMonth(day) → {LocalDateTime}

Create a datetime instance with updated Day Of The Month
Parameters:
Name Type Description
day integer of the month
Source:
Returns:
Returns a copy of this datetime with the day of month field updated.
Type
LocalDateTime

withDayOfYear(day) → {LocalDateTime}

Create a datetime instance with updated Day Of The Year
Parameters:
Name Type Description
day integer of the year
Source:
Returns:
Returns a copy of this datetime with the day of year field updated.
Type
LocalDateTime

withHour(hour) → {LocalDateTime}

Create a datetime instance with updated Hour of Day
Parameters:
Name Type Description
hour integer of the day
Source:
Returns:
Returns a copy of this datetime with the hour of day field updated.
Type
LocalDateTime

withMinute(minute) → {LocalDateTime}

Create a datetime instance with updated Minute Of Hour
Parameters:
Name Type Description
minute integer of the hour
Source:
Returns:
Returns a copy of this datetime with the minute of hour field updated.
Type
LocalDateTime

withMonth(month) → {LocalDateTime}

Create a datetime instance with updated Month Of Year
Parameters:
Name Type Description
month integer of the year
Source:
Returns:
Returns a copy of this datetime with the month of year field updated.
Type
LocalDateTime

withNano(nano) → {LocalDateTime}

Create a datetime instance with updated Nano Of Second
Parameters:
Name Type Description
nano integer of the second
Source:
Returns:
Returns a copy of this datetime with the nano of second field updated.
Type
LocalDateTime

withSecond(second) → {LocalDateTime}

Create a datetime instance with updated Second Of Minute
Parameters:
Name Type Description
second integer of the minute
Source:
Returns:
Returns a copy of this datetime with the second of minute field updated.
Type
LocalDateTime

withYear(the) → {LocalDateTime}

Create a datetime instance with updated year
Parameters:
Name Type Description
the integer year
Source:
Returns:
Returns a copy of this datetime with the year field updated.
Type
LocalDateTime

year() → {integer}

Gets the year of this date instace.
Source:
Returns:
Returns the year of this date instace.
Type
integer