Import std.time.calendar
LocalDateTime
struct
Public Struct LocalDateTime Implements Comparable, Hashable, Printable, Defaultable
A date and a time of day, without a zone, as a wall calendar and clock show them.
Examples
Local meeting = LocalDateTime(2024, 3, 9, 14, 30)
Expect("{meeting}" == "2024-03-09T14:30:00")
Expect(meeting.AddDays(1).Date == Date(2024, 3, 10))
Expect(LocalDateTime.Parse("2024-03-09T14:30:00") == meeting)std/time/calendar.fb, line 407
-
The time of day
timeondate. -
@PanicsAtCaller Public New(year: Int, month: Int, day: Int, hour: Int = 0, minute: Int = 0, second: Int = 0, nanosecond: Int = 0)constructor #The date and time, which panics when either isn't one.
-
Midnight on 1970-01-01.
-
The earliest LocalDateTime there is.
-
The latest LocalDateTime there is.
-
Now, where the
zoneis, or the OS'szone. -
Now, in the OS's zone.
-
The date and time ISO 8601 writes, like "2026-10-23T12:30:00", with "T", "t", or a space between them, or Null.
-
@PanicsAtCaller Public Static Method Parse(text: String, pattern: String): LocalDateTime?static method #The date and time the
textwrites as thepatternsays (see format.fb), or Null. A pattern without the year, or without the month and day or the day of the year, panics; the time's parts it doesn't have are 0. -
Its date.
-
Its time of day.
-
Its date's year.
-
Its date's month, from 1 to 12.
-
Its date's day of the month, from 1.
-
Its hour, from 0 to 23.
-
Its minute, from 0 to 59.
-
Its second, from 0 to 59.
-
Its nanosecond of the second.
-
Its date's day of the week.
-
Its date's day of the year, from 1.
-
The same time
countdays after, or before, as Date's AddDays goes. -
The same time
countmonths after, or before, as Date's AddMonths goes. -
The same time
countyears after, or before, as Date's AddYears goes. -
Midnight on its day.
-
@PanicsAtCaller Public Method InZone(zone: TimeZone, disambiguation: Disambiguation = Disambiguation.COMPATIBLE): ZonedDateTimemethod #It where the
zoneis. When thezone's clocks show it twice, as they're turned back, or never, as they skip it, thedisambiguationsays which moment it is (seezone.fb). -
baftera, on a clock that's never turned: 23:00 plus 2 hours is 01:00 the next day. -
bbeforea, on a clock that's never turned: 01:00 minus 2 hours is 23:00 the day before. -
How long it is from
btoa, on a clock that's never turned, which panics past the longest Duration. -
Whether
ais beforeb. -
As ISO 8601 writes it, like "2026-10-23T12:30:00".
-
As the
patternsays (see format.fb): Format("yyyy-MM-dd HH:mm") is "2026-10-23 12:30". Apatternletter of a zone panics.
Report an issue with this page or with FutureBlitz on GitHub.