java_time_utils
Module java_time_utils
API
Declarations
Definitions
kruutteri1/java_time_utils
Overview
A Ballerina wrapper around java.time โ LocalDate, LocalDateTime, and LocalTime for working with dates and times without time zones.
java.time is the gold standard for date and time handling on the JVM. java_time_utils brings that same power into Ballerina โ precise date/time arithmetic, immutable values, and predictable behavior, without reaching for a full-blown time-zone library when you don't need one.
Installation
# Ballerina.toml [[dependency]] org = "kruutteri1" name = "java_time_utils" version = "1.0.4" # check central.ballerina.io for the latest version
import kruutteri1/java_time_utils as jt;
Quick Start
import ballerina/io; import kruutteri1/java_time_utils as jt; public function main() { jt:LocalDate date = jt:ofDate(2026, 7, 15); jt:LocalTime time = jt:ofTimeWithSecond(14, 28, 19); jt:LocalDateTime dateTime = jt:ofLocalDateWithLocalTime(date, time); io:println(date.toString()); // 2026-07-15 io:println(time.toString()); // 14:28:19 io:println(dateTime.toString()); // 2026-07-15T14:28:19 }
Getting the Current Date and Time Without Zone
import ballerina/io; import kruutteri1/java_time_utils as jt; public function main() { jt:LocalDate today = jt:getCurrentDate(); jt:LocalTime now = jt:getCurrentTime(); jt:LocalDateTime currentDateTime = jt:getCurrentDateTime(); io:println("Today: ", today.toString()); io:println("Now: ", now.toString()); io:println("Current date-time: ", currentDateTime.toString()); }
Features
- ๐ LocalDate โ dates without time or time zone
- ๐๏ธ LocalDateTime โ dates with time, no time zone
- ๐ LocalTime โ time of day without date or time zone
- Immutable API โ every
plus*,minus*, andwith*method returns a new object - Familiar
java.timesemantics, ported to idiomatic Ballerina
Functions
createObject
function createObject() returns ObjectCreates a new instance of java.lang.Object.
Return Type
- Object -ย A new Object instance.
getCurrentDate
function getCurrentDate() returns LocalDateObtains the current date from the system clock in the default time-zone.
Return Type
- LocalDate -ย The current LocalDate.
getCurrentDateTime
function getCurrentDateTime() returns LocalDateTimeObtains the current date-time from the system clock in the default time-zone.
Return Type
- LocalDateTime -ย The current LocalDateTime.
getCurrentTime
function getCurrentTime() returns LocalTimeObtains the current time from the system clock in the default time-zone.
Return Type
- LocalTime -ย The current time.
getEPOCHDate
function getEPOCHDate() returns LocalDateReturns the epoch date (1970-01-01).
Return Type
- LocalDate -ย The EPOCH constant.
getMAXDate
function getMAXDate() returns LocalDateReturns the maximum supported LocalDate (year 999999999-12-31).
Return Type
- LocalDate -ย The MAX constant.
getMAXDateTime
function getMAXDateTime() returns LocalDateTimeRetrieves the maximum supported LocalDateTime (+999999999-12-31T23:59:59.999999999).
Return Type
- LocalDateTime -ย The maximum LocalDateTime.
getMAXTime
function getMAXTime() returns LocalTimeRetrieves the value of the public field MAX.
Return Type
- LocalTime -ย The
LocalTimevalue of the field.
getMIDNIGHT
function getMIDNIGHT() returns LocalTimeRetrieves the value of the public field MIDNIGHT.
Return Type
- LocalTime -ย The
LocalTimevalue of the field.
getMINDate
function getMINDate() returns LocalDateReturns the minimum supported LocalDate (year -999999999-01-01).
Return Type
- LocalDate -ย The MIN constant.
getMINDateTime
function getMINDateTime() returns LocalDateTimeRetrieves the minimum supported LocalDateTime (-999999999-01-01T00:00:00).
Return Type
- LocalDateTime -ย The minimum LocalDateTime.
getMinTime
function getMinTime() returns LocalTimeRetrieves the value of the public field MIN.
Return Type
- LocalTime -ย The
LocalTimevalue of the field.
getNOON
function getNOON() returns LocalTimeRetrieves the value of the public field NOON.
Return Type
- LocalTime -ย The
LocalTimevalue cแปงa the field.
ofDate
Obtains a LocalDate from a year, month, and day.
Parameters
- year int -ย The year.
- month int -ย The month-of-year (1-12).
- day int -ย The day-of-month (1-31).
Return Type
- LocalDate -ย The LocalDate.
ofDateTime
function ofDateTime(int year, int month, int dayOfMonth, int hour, int minute) returns LocalDateTimeObtains an instance of LocalDateTime from year, month, day, hour, and minute.
Parameters
- year int -ย The year to represent.
- month int -ย The month-of-year to represent (1-12).
- dayOfMonth int -ย The day-of-month to represent (1-31).
- hour int -ย The hour-of-day to represent (0-23).
- minute int -ย The minute-of-hour to represent (0-59).
Return Type
- LocalDateTime -ย The LocalDateTime.
ofEpochDay
Obtains a LocalDate from the epoch day count.
Parameters
- epochDay int -ย The number of days from the epoch of 1970-01-01.
Return Type
- LocalDate -ย The LocalDate.
ofLocalDateWithLocalTime
function ofLocalDateWithLocalTime(LocalDate date, LocalTime time) returns LocalDateTimeObtains an instance of LocalDateTime from a LocalDate and LocalTime.
Return Type
- LocalDateTime -ย The LocalDateTime.
ofNanoOfDay
Obtains an instance of LocalTime from a nanos-of-day value.
Parameters
- nanoOfDay int -ย The nanos of day.
Return Type
- LocalTime -ย The LocalTime.
ofSecondOfDay
Obtains an instance of LocalTime from a second-of-day value.
Parameters
- secondOfDay int -ย The second of day.
Return Type
- LocalTime -ย The LocalTime.
ofTime
Obtains an instance of LocalTime from an hour and minute.
Return Type
- LocalTime -ย The LocalTime.
ofTimeWithSecond
Obtains an instance of LocalTime from an hour, minute and second.
Parameters
- hour int -ย The hour-of-day to represent.
- minute int -ย The minute-of-hour to represent.
- second int -ย The second-of-minute to represent.
Return Type
- LocalTime -ย The LocalTime.
ofTimeWithSecondNano
Obtains an instance of LocalTime from an hour, minute, second and nanosecond.
Parameters
- hour int -ย The hour-of-day.
- minute int -ย The minute-of-hour.
- second int -ย The second-of-minute.
- nanoOfSecond int -ย The nano-of-second.
Return Type
- LocalTime -ย The LocalTime.
ofWithNanos
function ofWithNanos(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) returns LocalDateTimeObtains an instance of LocalDateTime from year, month, day, hour, minute, second, and nanosecond.
Parameters
- year int -ย The year to represent.
- month int -ย The month-of-year to represent (1-12).
- dayOfMonth int -ย The day-of-month to represent (1-31).
- hour int -ย The hour-of-day to represent (0-23).
- minute int -ย The minute-of-hour to represent (0-59).
- second int -ย The second-of-minute to represent (0-59).
- nanoOfSecond int -ย The nano-of-second to represent (0-999,999,999).
Return Type
- LocalDateTime -ย The LocalDateTime.
ofWithSeconds
function ofWithSeconds(int year, int month, int dayOfMonth, int hour, int minute, int second) returns LocalDateTimeObtains an instance of LocalDateTime from year, month, day, hour, minute, and second.
Parameters
- year int -ย The year to represent.
- month int -ย The month-of-year to represent (1-12).
- dayOfMonth int -ย The day-of-month to represent (1-31).
- hour int -ย The hour-of-day to represent (0-23).
- minute int -ย The minute-of-hour to represent (0-59).
- second int -ย The second-of-minute to represent (0-59).
Return Type
- LocalDateTime -ย The LocalDateTime.
ofYearDay
Obtains a LocalDate from a year and day-of-year.
Return Type
- LocalDate -ย The LocalDate.
Classes
java_time_utils: CharSequence
Ballerina class mapping for the Java java.lang.CharSequence interface.
Constructor
The init function of the Ballerina class mapping the java.lang.CharSequence Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.lang.CharSequence Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.lang.CharSequenceobject.
java_time_utils: ChronoLocalDate
Ballerina class mapping for the Java java.time.chrono.ChronoLocalDate interface.
Constructor
The init function of the Ballerina class mapping the java.time.chrono.ChronoLocalDate Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.chrono.ChronoLocalDate Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.chrono.ChronoLocalDateobject.
java_time_utils: ChronoLocalDateTime
Ballerina class mapping for the Java java.time.chrono.ChronoLocalDateTime interface.
Constructor
The init function of the Ballerina class mapping the java.time.chrono.ChronoLocalDateTime Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.chrono.ChronoLocalDateTime Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.chrono.ChronoLocalDateTimeobject.
java_time_utils: Chronology
Ballerina class mapping for the Java java.time.chrono.Chronology interface.
Constructor
The init function of the Ballerina class mapping the java.time.chrono.Chronology Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.chrono.Chronology Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.chrono.Chronologyobject.
java_time_utils: Class
Ballerina class mapping for the Java java.lang.Class class.
Constructor
The init function of the Ballerina class mapping the java.lang.Class Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.lang.Class Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.lang.Classobject.
java_time_utils: Clock
Ballerina class mapping for the Java java.time.Clock class.
Constructor
The init function of the Ballerina class mapping the java.time.Clock Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.Clock Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.Clockobject.
java_time_utils: DateTimeFormatter
Ballerina class mapping for the Java java.time.format.DateTimeFormatter class.
Constructor
The init function of the Ballerina class mapping the java.time.format.DateTimeFormatter Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.format.DateTimeFormatter Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.format.DateTimeFormatterobject.
java_time_utils: DayOfWeek
Ballerina class mapping for the Java java.time.DayOfWeek class.
Constructor
The init function of the Ballerina class mapping the java.time.DayOfWeek Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.DayOfWeek Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.DayOfWeekobject.
java_time_utils: Instant
Ballerina class mapping for the Java java.time.Instant class.
Constructor
The init function of the Ballerina class mapping the java.time.Instant Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.Instant Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.Instantobject.
java_time_utils: IsoChronology
Ballerina class mapping for the Java java.time.chrono.IsoChronology class.
Constructor
The init function of the Ballerina class mapping the java.time.chrono.IsoChronology Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.chrono.IsoChronology Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.chrono.IsoChronologyobject.
java_time_utils: IsoEra
Ballerina class mapping for the Java java.time.chrono.IsoEra class.
Constructor
The init function of the Ballerina class mapping the java.time.chrono.IsoEra Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.chrono.IsoEra Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.chrono.IsoEraobject.
java_time_utils: LocalDate
Represents a date without a time-zone in the ISO-8601 calendar system, such as 2026-07-15.
Constructor
Initializes the LocalDate wrapper.
init (handle obj)- obj handle -ย The handle value containing the Java reference.
toString
function toString() returns stringReturns the string representation of this date in ISO-8601 format.
Return Type
- string -ย The string form (e.g., "2026-07-15").
atStartOfDay
function atStartOfDay() returns LocalDateTimeReturns a LocalDateTime formed from this date at the start of the day (00:00).
Return Type
- LocalDateTime -ย The resulting LocalDateTime.
atTime
function atTime(int hour, int minute) returns LocalDateTimeCombines this date with the specified time to create a LocalDateTime.
Return Type
- LocalDateTime -ย The resulting LocalDateTime.
atTimeDetailed
function atTimeDetailed(int hour, int minute, int second) returns LocalDateTimeCombines this date with the specified time (hours, minutes, seconds) to create a LocalDateTime.
Parameters
- hour int -ย The hour (0-23).
- minute int -ย The minute (0-59).
- second int -ย The second (0-59).
Return Type
- LocalDateTime -ย The resulting LocalDateTime.
atTimeFull
function atTimeFull(int hour, int minute, int second, int nano) returns LocalDateTimeCombines this date with the specified time (hours, minutes, seconds, nanos) to create a LocalDateTime.
Parameters
- hour int -ย The hour.
- minute int -ย The minute.
- second int -ย The second.
- nano int -ย The nanosecond.
Return Type
- LocalDateTime -ย The resulting LocalDateTime.
atLocalTime
function atLocalTime(LocalTime time) returns LocalDateTimeCombines this date with the specified LocalTime to create a LocalDateTime.
Parameters
- time LocalTime -ย The LocalTime to combine with this date.
Return Type
- LocalDateTime -ย The resulting LocalDateTime.
datesUntil
Returns a stream of dates from this date until the specified end date.
Parameters
- endExclusive LocalDate -ย The end date, exclusive.
Return Type
- Stream -ย A stream of dates.
isEquals
Checks if this date is equal to another object.
Parameters
- other Object -ย The object to check equality with.
Return Type
- boolean -ย True if equal, false otherwise.
getChronology
function getChronology() returns IsoChronologyReturns the chronology of this date.
Return Type
- IsoChronology -ย The ISO chronology.
getClass
function getClass() returns ClassReturns the class of this object.
Return Type
- Class -ย The Java class instance.
getDayOfMonth
function getDayOfMonth() returns intReturns the day-of-month.
Return Type
- int -ย The day-of-month, from 1 to 31.
getDayOfWeek
function getDayOfWeek() returns DayOfWeekReturns the day-of-week.
Return Type
- DayOfWeek -ย The day-of-week enum.
getDayOfYear
function getDayOfYear() returns intReturns the day-of-year.
Return Type
- int -ย The day-of-year, from 1 to 365 or 366.
getEra
function getEra() returns IsoEraReturns the era.
Return Type
- IsoEra -ย The era constant.
getMonth
function getMonth() returns MonthReturns the month-of-year.
Return Type
- Month -ย The month enum.
getMonthValue
function getMonthValue() returns intReturns the month-of-year value (1-12).
Return Type
- int -ย The month-of-year.
getYear
function getYear() returns intReturns the year.
Return Type
- int -ย The year.
hashCode
function hashCode() returns intReturns the hash code for this date.
Return Type
- int -ย The hash code.
isLeapYear
function isLeapYear() returns booleanChecks if the year is a leap year.
Return Type
- boolean -ย True if the year is a leap year.
lengthOfMonth
function lengthOfMonth() returns intReturns the length of the month represented by this date.
Return Type
- int -ย The length of the month.
lengthOfYear
function lengthOfYear() returns intReturns the length of the year represented by this date.
Return Type
- int -ย The length of the year.
minusDays
Returns a copy of this date with the specified number of days subtracted.
Parameters
- days int -ย The days to subtract.
Return Type
- LocalDate -ย A date with the days subtracted.
minusMonths
Returns a copy of this date with the specified number of months subtracted.
Parameters
- months int -ย The months to subtract.
Return Type
- LocalDate -ย A date with the months subtracted.
minusWeeks
Returns a copy of this date with the specified number of weeks subtracted.
Parameters
- weeks int -ย The number of weeks to subtract.
Return Type
- LocalDate -ย A new LocalDate with the weeks subtracted.
minusYears
Returns a copy of this date with the specified number of years subtracted.
Parameters
- years int -ย The number of years to subtract.
Return Type
- LocalDate -ย A new LocalDate with the years subtracted.
notify
function notify()Wakes up a single thread that is waiting on this object's monitor. WARNING: This is a low-level Java synchronization method. Avoid using it in business logic.
notifyAll
function notifyAll()Wakes up all threads that are waiting on this object's monitor. WARNING: This is a low-level Java synchronization method. Avoid using it in business logic.
plusDays
Returns a copy of this date with the specified number of days added.
Parameters
- days int -ย The number of days to add, may be negative.
Return Type
- LocalDate -ย A new LocalDate with the days added.
plusMonths
Returns a copy of this date with the specified number of months added.
Parameters
- months int -ย The number of months to add, may be negative.
Return Type
- LocalDate -ย A new LocalDate with the months added.
plusWeeks
Returns a copy of this date with the specified number of weeks added.
Parameters
- weeks int -ย The number of weeks to add, may be negative.
Return Type
- LocalDate -ย A new LocalDate with the weeks added.
plusYears
Returns a copy of this date with the specified number of years added.
Parameters
- years int -ย The number of years to add, may be negative.
Return Type
- LocalDate -ย A new LocalDate with the years added.
toEpochDay
function toEpochDay() returns intReturns the epoch day count.
Return Type
- int -ย The epoch day count.
doWait
function doWait() returns InterruptedException?Causes the current thread to wait until notified. WARNING: Low-level Java synchronization method. Use with caution.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
waitWithTimeout
function waitWithTimeout(int timeoutMillis) returns InterruptedException?Causes the current thread to wait until notified or the specified time elapses. WARNING: Low-level Java synchronization method. Use with caution.
Parameters
- timeoutMillis int -ย The maximum time to wait in milliseconds.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
waitWithTimeoutAndNanos
function waitWithTimeoutAndNanos(int timeoutMillis, int nanos) returns InterruptedException?Causes the current thread to wait until notified, with the specified timeout. WARNING: Low-level Java synchronization method. Use with caution.
Parameters
- timeoutMillis int -ย The maximum time to wait in milliseconds.
- nanos int -ย Additional nanoseconds to wait.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
withDayOfMonth
Returns a copy of this date with the day-of-month altered.
Parameters
- dayOfMonth int -ย The day-of-month to set (1-31).
Return Type
- LocalDate -ย A new LocalDate with the day-of-month set.
withDayOfYear
Returns a copy of this date with the day-of-year altered.
Parameters
- dayOfYear int -ย The day-of-year to set (1-365/366).
Return Type
- LocalDate -ย A new LocalDate with the day-of-year set.
withMonth
Returns a copy of this date with the month-of-year altered.
Parameters
- month int -ย The month-of-year to set (1-12).
Return Type
- LocalDate -ย A new LocalDate with the month set.
withYear
Returns a copy of this date with the year altered.
Parameters
- year int -ย The year to set.
Return Type
- LocalDate -ย A new LocalDate with the year set.
Fields
- Fields Included from *JObject
- jObj handle
- Fields Included from *Object
- jObj handle
- jObj handle - The handle to the underlying Java object.
java_time_utils: LocalDateTime
Represents a date-time without a time-zone in the ISO-8601 calendar system, such as 2026-07-15T14:28:19.
Constructor
Initializes the LocalDateTime wrapper.
init (handle obj)- obj handle -ย The handle value containing the Java reference.
toString
function toString() returns stringReturns the string representation of this date-time in ISO-8601 format.
Return Type
- string -ย The string form (e.g., "2026-07-15T14:28:19").
isEquals
Checks if this date-time is equal to another object.
Parameters
- other Object -ย The object to check equality with.
Return Type
- boolean -ย True if equal, false otherwise.
getChronology
function getChronology() returns ChronologyReturns the chronology of this date-time.
Return Type
- Chronology -ย The ISO chronology.
getClass
function getClass() returns ClassReturns the class of this object.
Return Type
- Class -ย The Java class instance.
getDayOfMonth
function getDayOfMonth() returns intReturns the day-of-month.
Return Type
- int -ย The day-of-month, from 1 to 31.
getDayOfWeek
function getDayOfWeek() returns DayOfWeekReturns the day-of-week.
Return Type
- DayOfWeek -ย The day-of-week enum.
getDayOfYear
function getDayOfYear() returns intReturns the day-of-year.
Return Type
- int -ย The day-of-year, from 1 to 365 or 366.
getHour
function getHour() returns intReturns the hour-of-day.
Return Type
- int -ย The hour-of-day, from 0 to 23.
getMinute
function getMinute() returns intReturns the minute-of-hour.
Return Type
- int -ย The minute-of-hour, from 0 to 59.
getMonth
function getMonth() returns MonthReturns the month-of-year.
Return Type
- Month -ย The month enum.
getMonthValue
function getMonthValue() returns intReturns the month-of-year value (1-12).
Return Type
- int -ย The month-of-year.
getNano
function getNano() returns intReturns the nano-of-second.
Return Type
- int -ย The nano-of-second, from 0 to 999,999,999.
getSecond
function getSecond() returns intReturns the second-of-minute.
Return Type
- int -ย The second-of-minute, from 0 to 59.
getYear
function getYear() returns intReturns the year.
Return Type
- int -ย The year.
hashCode
function hashCode() returns intReturns the hash code for this date-time.
Return Type
- int -ย The hash code.
minusDays
function minusDays(int days) returns LocalDateTimeReturns a copy of this date-time with the specified number of days subtracted.
Parameters
- days int -ย The days to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the days subtracted.
minusHours
function minusHours(int hours) returns LocalDateTimeReturns a copy of this date-time with the specified number of hours subtracted.
Parameters
- hours int -ย The hours to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the hours subtracted.
minusMinutes
function minusMinutes(int minutes) returns LocalDateTimeReturns a copy of this date-time with the specified number of minutes subtracted.
Parameters
- minutes int -ย The minutes to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the minutes subtracted.
minusMonths
function minusMonths(int months) returns LocalDateTimeReturns a copy of this date-time with the specified number of months subtracted.
Parameters
- months int -ย The months to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the months subtracted.
minusNanos
function minusNanos(int nanos) returns LocalDateTimeReturns a copy of this date-time with the specified number of nanoseconds subtracted.
Parameters
- nanos int -ย The nanoseconds to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the nanoseconds subtracted.
minusSeconds
function minusSeconds(int seconds) returns LocalDateTimeReturns a copy of this date-time with the specified number of seconds subtracted.
Parameters
- seconds int -ย The seconds to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the seconds subtracted.
minusWeeks
function minusWeeks(int weeks) returns LocalDateTimeReturns a copy of this date-time with the specified number of weeks subtracted.
Parameters
- weeks int -ย The weeks to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the weeks subtracted.
minusYears
function minusYears(int years) returns LocalDateTimeReturns a copy of this date-time with the specified number of years subtracted.
Parameters
- years int -ย The years to subtract.
Return Type
- LocalDateTime -ย A new LocalDateTime with the years subtracted.
notify
function notify()Wakes up a single thread that is waiting on this object's monitor. WARNING: Low-level Java synchronization method. Avoid using in business logic.
notifyAll
function notifyAll()Wakes up all threads that are waiting on this object's monitor. WARNING: Low-level Java synchronization method. Avoid using in business logic.
plusDays
function plusDays(int days) returns LocalDateTimeReturns a copy of this date-time with the specified number of days added.
Parameters
- days int -ย The number of days to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the days added.
plusHours
function plusHours(int hours) returns LocalDateTimeReturns a copy of this date-time with the specified number of hours added.
Parameters
- hours int -ย The number of hours to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the hours added.
plusMinutes
function plusMinutes(int minutes) returns LocalDateTimeReturns a copy of this date-time with the specified number of minutes added.
Parameters
- minutes int -ย The number of minutes to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the minutes added.
plusMonths
function plusMonths(int months) returns LocalDateTimeReturns a copy of this date-time with the specified number of months added.
Parameters
- months int -ย The number of months to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the months added.
plusNanos
function plusNanos(int nanos) returns LocalDateTimeReturns a copy of this date-time with the specified number of nanoseconds added.
Parameters
- nanos int -ย The number of nanoseconds to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the nanoseconds added.
plusSeconds
function plusSeconds(int seconds) returns LocalDateTimeReturns a copy of this date-time with the specified number of seconds added.
Parameters
- seconds int -ย The number of seconds to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the seconds added.
plusWeeks
function plusWeeks(int weeks) returns LocalDateTimeReturns a copy of this date-time with the specified number of weeks added.
Parameters
- weeks int -ย The number of weeks to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the weeks added.
plusYears
function plusYears(int years) returns LocalDateTimeReturns a copy of this date-time with the specified number of years added.
Parameters
- years int -ย The number of years to add.
Return Type
- LocalDateTime -ย A new LocalDateTime with the years added.
toLocalDate
function toLocalDate() returns LocalDateGets the LocalDate part of this date-time.
Return Type
- LocalDate -ย The date part of this date-time.
toLocalTime
function toLocalTime() returns LocalTimeGets the LocalTime part of this date-time.
Return Type
- LocalTime -ย The time part of this date-time.
doWait
function doWait() returns InterruptedException?Causes the current thread to wait until notified. WARNING: Low-level Java synchronization method. Use with caution.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
waitWithTimeout
function waitWithTimeout(int timeoutMillis) returns InterruptedException?Causes the current thread to wait until notified or the specified time elapses. WARNING: Low-level Java synchronization method. Use with caution.
Parameters
- timeoutMillis int -ย The maximum time to wait in milliseconds.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
waitWithTimeoutAndNanos
function waitWithTimeoutAndNanos(int timeoutMillis, int nanos) returns InterruptedException?Causes the current thread to wait until notified, with the specified timeout. WARNING: Low-level Java synchronization method. Use with caution.
Parameters
- timeoutMillis int -ย The maximum time to wait in milliseconds.
- nanos int -ย Additional nanoseconds to wait.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
withDayOfMonth
function withDayOfMonth(int dayOfMonth) returns LocalDateTimeReturns a copy of this date-time with the day-of-month altered.
Parameters
- dayOfMonth int -ย The day-of-month to set (1-31).
Return Type
- LocalDateTime -ย A new LocalDateTime with the day-of-month set.
withDayOfYear
function withDayOfYear(int dayOfYear) returns LocalDateTimeReturns a copy of this date-time with the day-of-year altered.
Parameters
- dayOfYear int -ย The day-of-year to set (1-365/366).
Return Type
- LocalDateTime -ย A new LocalDateTime with the day-of-year set.
withHour
function withHour(int hour) returns LocalDateTimeReturns a copy of this date-time with the hour-of-day altered.
Parameters
- hour int -ย The hour-of-day to set (0-23).
Return Type
- LocalDateTime -ย A new LocalDateTime with the hour set.
withMinute
function withMinute(int minute) returns LocalDateTimeReturns a copy of this date-time with the minute-of-hour altered.
Parameters
- minute int -ย The minute-of-hour to set (0-59).
Return Type
- LocalDateTime -ย A new LocalDateTime with the minute set.
withMonth
function withMonth(int month) returns LocalDateTimeReturns a copy of this date-time with the month-of-year altered.
Parameters
- month int -ย The month-of-year to set (1-12).
Return Type
- LocalDateTime -ย A new LocalDateTime with the month set.
withNano
function withNano(int nano) returns LocalDateTimeReturns a copy of this date-time with the nano-of-second altered.
Parameters
- nano int -ย The nano-of-second to set (0-999,999,999).
Return Type
- LocalDateTime -ย A new LocalDateTime with the nano-of-second set.
withSecond
function withSecond(int second) returns LocalDateTimeReturns a copy of this date-time with the second-of-minute altered.
Parameters
- second int -ย The second-of-minute to set (0-59).
Return Type
- LocalDateTime -ย A new LocalDateTime with the second-of-minute set.
withYear
function withYear(int year) returns LocalDateTimeReturns a copy of this date-time with the year altered.
Parameters
- year int -ย The year to set.
Return Type
- LocalDateTime -ย A new LocalDateTime with the year set.
Fields
- Fields Included from *JObject
- jObj handle
- Fields Included from *Object
- jObj handle
- jObj handle - The handle field that stores the reference to the Java object.
java_time_utils: LocalTime
A time without a time-zone in the ISO-8601 calendar system, such as 10:15:30. This is a value-based class; use of identity-sensitive operations on instances of LocalTime may have unpredictable results and should be avoided.
Constructor
Initializes the class with a handle to a Java object.
init (handle obj)- obj handle -ย The handle reference to the Java object.
toString
function toString() returns stringReturns the ISO-8601 string representation of this time.
Return Type
- string -ย The time as a string, e.g., 10:15:30.
atDate
function atDate(LocalDate date) returns LocalDateTimeCombines this time with a date to create a LocalDateTime.
Parameters
- date LocalDate -ย The date to combine with.
Return Type
- LocalDateTime -ย The local date-time formed from this time and the specified date.
compareTo
Compares this time to another time.
Parameters
- other LocalTime -ย The other time to compare to.
Return Type
- int -ย A negative integer, zero, or a positive integer as this time is less than, equal to, or greater than the specified time.
isEquals
Checks if this time is equal to another object.
Parameters
- other Object -ย The object to check for equality.
Return Type
- boolean -ย True if this time is equal to the specified object.
getClass
function getClass() returns ClassReturns the runtime class of this object.
Return Type
- Class -ย The Class object representing the runtime class.
getHour
function getHour() returns intGets the hour-of-day field.
Return Type
- int -ย The hour-of-day, from 0 to 23.
getMinute
function getMinute() returns intGets the minute-of-hour field.
Return Type
- int -ย The minute-of-hour, from 0 to 59.
getNano
function getNano() returns intGets the nano-of-second field.
Return Type
- int -ย The nano-of-second, from 0 to 999,999,999.
getSecond
function getSecond() returns intGets the second-of-minute field.
Return Type
- int -ย The second-of-minute, from 0 to 59.
hashCode
function hashCode() returns intReturns the hash code for this time.
Return Type
- int -ย A suitable hash code.
isAfter
Checks if this time is after the specified time.
Parameters
- other LocalTime -ย The other time to compare to.
Return Type
- boolean -ย True if this time is after the specified time.
isBefore
Checks if this time is before the specified time.
Parameters
- other LocalTime -ย The other time to compare to.
Return Type
- boolean -ย True if this time is before the specified time.
minusHours
Returns a copy of this time with the specified number of hours subtracted.
Parameters
- hours int -ย The hours to subtract.
Return Type
- LocalTime -ย A LocalTime based on this one with the hours subtracted.
minusMinutes
Returns a copy of this time with the specified number of minutes subtracted.
Parameters
- minutes int -ย The minutes to subtract.
Return Type
- LocalTime -ย A LocalTime based on this one with the minutes subtracted.
minusNanos
Returns a copy of this time with the specified number of nanoseconds subtracted.
Parameters
- nanos int -ย The nanoseconds to subtract.
Return Type
- LocalTime -ย A LocalTime based on this one with the nanoseconds subtracted.
minusSeconds
Returns a copy of this time with the specified number of seconds subtracted.
Parameters
- seconds int -ย The seconds to subtract.
Return Type
- LocalTime -ย A LocalTime based on this one with the seconds subtracted.
notify
function notify()Wakes up a single thread that is waiting on this object's monitor.
notifyAll
function notifyAll()Wakes up all threads that are waiting on this object's monitor.
plusHours
Returns a copy of this time with the specified number of hours added.
Parameters
- hours int -ย The hours to add.
Return Type
- LocalTime -ย A LocalTime based on this one with the hours added.
plusMinutes
Returns a copy of this time with the specified number of minutes added.
Parameters
- minutes int -ย The minutes to add.
Return Type
- LocalTime -ย A LocalTime based on this one with the minutes added.
plusNanos
Returns a copy of this time with the specified number of nanoseconds added.
Parameters
- nanos int -ย The nanoseconds to add.
Return Type
- LocalTime -ย A LocalTime based on this one with the nanoseconds added.
plusSeconds
Returns a copy of this time with the specified number of seconds added.
Parameters
- seconds int -ย The seconds to add.
Return Type
- LocalTime -ย A LocalTime based on this one with the seconds added.
toNanoOfDay
function toNanoOfDay() returns intExtracts the time as nanoseconds of day.
Return Type
- int -ย The nanoseconds of day.
toSecondOfDay
function toSecondOfDay() returns intExtracts the time as seconds of day.
Return Type
- int -ย The seconds of day.
doWait
function doWait() returns InterruptedException?Waits to be notified by another thread.
Return Type
- InterruptedException? -ย An error if the wait is interrupted, or () if successful.
waitWithTimeout
function waitWithTimeout(int timeoutMillis) returns InterruptedException?Waits to be notified by another thread for a specified amount of time.
Parameters
- timeoutMillis int -ย The maximum time to wait in milliseconds.
Return Type
- InterruptedException? -ย An error if the wait is interrupted, or () if successful.
waitWithTimeoutAndNanos
function waitWithTimeoutAndNanos(int timeoutMillis, int nanos) returns InterruptedException?Waits to be notified by another thread for a specified amount of time.
Parameters
- timeoutMillis int -ย The maximum time to wait in milliseconds.
- nanos int -ย The additional nanoseconds to wait.
Return Type
- InterruptedException? -ย An error if the wait is interrupted, or () if successful.
withHour
Returns a copy of this time with the hour-of-day altered.
Parameters
- hour int -ย The hour-of-day to set in the result.
Return Type
- LocalTime -ย A LocalTime based on this one with the requested hour.
withMinute
Returns a copy of this time with the minute-of-hour altered.
Parameters
- minute int -ย The minute-of-hour to set in the result.
Return Type
- LocalTime -ย A LocalTime based on this one with the requested minute.
withNano
Returns a copy of this time with the nano-of-second altered.
Parameters
- nano int -ย The nano-of-second to set in the result.
Return Type
- LocalTime -ย A LocalTime based on this one with the requested nano-of-second.
withSecond
Returns a copy of this time with the second-of-minute altered.
Parameters
- second int -ย The second-of-minute to set in the result.
Return Type
- LocalTime -ย A LocalTime based on this one with the requested second.
Fields
- Fields Included from *JObject
- jObj handle
- Fields Included from *Object
- jObj handle
- jObj handle - The handle to the underlying Java object.
java_time_utils: Month
Ballerina class mapping for the Java java.time.Month class.
Constructor
The init function of the Ballerina class mapping the java.time.Month Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.Month Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.Monthobject.
java_time_utils: Object
Ballerina wrapper for the Java java.lang.Object class.
Object is the root type used across this library so that different
time-related classes (LocalDate, LocalDateTime, LocalTime) can share
a common contract for equality, hashing, and low-level Java thread
synchronization.@java:Binding {'class: "java.lang.Object"}
Constructor
Initializes the Object wrapper.
init (handle obj)- obj handle -ย The handle value containing the Java reference.
toString
function toString() returns stringReturns the string representation of this object.
Return Type
- string -ย The string form of the Java object instance.
isEquals
Checks if this object is equal to another object.
Note: this delegates directly to Java's equals method on Object, which
compares by reference identity unless the underlying Java class
overrides it. Subclasses in this library (e.g. LocalDate,
LocalDateTime, LocalTime) provide their own value-based equality
instead of relying on this default behavior.
Parameters
- other Object -ย The object to compare against.
Return Type
- boolean -ย True if the two objects are equal, false otherwise.
getClass
function getClass() returns ClassReturns the runtime class of this object.
Return Type
- Class -ย The Class instance representing this object's runtime type.
hashCode
function hashCode() returns intReturns the hash code value for this object.
Return Type
- int -ย The hash code.
notify
function notify()Wakes up a single thread that is waiting on this object's monitor.
WARNING: This is a low-level Java synchronization method. Avoid using it in business logic.
notifyAll
function notifyAll()Wakes up all threads that are waiting on this object's monitor.
WARNING: This is a low-level Java synchronization method. Avoid using it in business logic.
doWait
function doWait() returns InterruptedException?Causes the current thread to wait until notified.
WARNING: Low-level Java synchronization method. Use with caution.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
waitWithTimeout
function waitWithTimeout(int timeoutMillis) returns InterruptedException?Causes the current thread to wait until notified or the specified time elapses.
WARNING: Low-level Java synchronization method. Use with caution.
Parameters
- timeoutMillis int -ย The maximum time to wait, in milliseconds.
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
waitWithTimeoutAndNanos
function waitWithTimeoutAndNanos(int timeoutMillis, int nanos) returns InterruptedException?Causes the current thread to wait until notified, with the specified timeout.
WARNING: Low-level Java synchronization method. Use with caution.
Parameters
- timeoutMillis int -ย The maximum time to wait, in milliseconds.
- nanos int -ย Additional nanoseconds to wait (0โ999,999).
Return Type
- InterruptedException? -ย An InterruptedException if the thread is interrupted while waiting.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The handle to the underlying Java object.
java_time_utils: OffsetDateTime
Ballerina class mapping for the Java java.time.OffsetDateTime class.
Constructor
The init function of the Ballerina class mapping the java.time.OffsetDateTime Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.OffsetDateTime Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.OffsetDateTimeobject.
java_time_utils: OffsetTime
Ballerina class mapping for the Java java.time.OffsetTime class.
Constructor
The init function of the Ballerina class mapping the java.time.OffsetTime Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.OffsetTime Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.OffsetTimeobject.
java_time_utils: Period
Ballerina class mapping for the Java java.time.Period class.
Constructor
The init function of the Ballerina class mapping the java.time.Period Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.Period Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.Periodobject.
java_time_utils: Stream
Ballerina class mapping for the Java java.util.stream.Stream interface.
Constructor
The init function of the Ballerina class mapping the java.util.stream.Stream Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.util.stream.Stream Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.util.stream.Streamobject.
java_time_utils: Temporal
Ballerina class mapping for the Java java.time.temporal.Temporal interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.Temporal Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.Temporal Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.Temporalobject.
java_time_utils: TemporalAccessor
Ballerina class mapping for the Java java.time.temporal.TemporalAccessor interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.TemporalAccessor Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.TemporalAccessor Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.TemporalAccessorobject.
java_time_utils: TemporalAdjuster
Ballerina class mapping for the Java java.time.temporal.TemporalAdjuster interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.TemporalAdjuster Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.TemporalAdjuster Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.TemporalAdjusterobject.
java_time_utils: TemporalAmount
Ballerina class mapping for the Java java.time.temporal.TemporalAmount interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.TemporalAmount Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.TemporalAmount Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.TemporalAmountobject.
java_time_utils: TemporalField
Ballerina class mapping for the Java java.time.temporal.TemporalField interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.TemporalField Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.TemporalField Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.TemporalFieldobject.
java_time_utils: TemporalQuery
Ballerina class mapping for the Java java.time.temporal.TemporalQuery interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.TemporalQuery Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.TemporalQuery Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.TemporalQueryobject.
java_time_utils: TemporalUnit
Ballerina class mapping for the Java java.time.temporal.TemporalUnit interface.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.TemporalUnit Java interface.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.TemporalUnit Java interface.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.TemporalUnitobject.
java_time_utils: ValueRange
Ballerina class mapping for the Java java.time.temporal.ValueRange class.
Constructor
The init function of the Ballerina class mapping the java.time.temporal.ValueRange Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.temporal.ValueRange Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.temporal.ValueRangeobject.
java_time_utils: ZonedDateTime
Ballerina class mapping for the Java java.time.ZonedDateTime class.
Constructor
The init function of the Ballerina class mapping the java.time.ZonedDateTime Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.ZonedDateTime Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.ZonedDateTimeobject.
java_time_utils: ZoneId
Ballerina class mapping for the Java java.time.ZoneId class.
Constructor
The init function of the Ballerina class mapping the java.time.ZoneId Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.ZoneId Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.ZoneIdobject.
java_time_utils: ZoneOffset
Ballerina class mapping for the Java java.time.ZoneOffset class.
Constructor
The init function of the Ballerina class mapping the java.time.ZoneOffset Java class.
init (handle obj)- obj handle -ย The
handlevalue containing the Java reference of the object.
toString
function toString() returns stringThe function to retrieve the string representation of the Ballerina class mapping the java.time.ZoneOffset Java class.
Return Type
- string -ย The
stringform of the Java object instance.
Fields
- Fields Included from *JObject
- jObj handle
- jObj handle - The
handlefield that stores the reference to thejava.time.ZoneOffsetobject.
Constants
java_time_utils: INTERRUPTEDEXCEPTION
Errors
java_time_utils: InterruptedException
Import
import kruutteri1/java_time_utils;Metadata
Released date:ย about 4 hours ago
Version:ย 1.0.4
License:ย Apache-2.0
Compatibility
Platform:ย java21
Ballerina version:ย 2201.13.4
GraalVM compatible:ย Yes
Pull count
Total:ย 2
Current verison:ย 0
Weekly downloads
Keywords
java-time
date
time
localdate
localdatetime
localtime
Contributors