CLOVIS
08/21/2024, 2:18 PMLocalDate.atTime
:
For finding an instant that corresponds to the start of a date in a particular time zone, consider using LocalDate.atStartOfDayIn function because a day does not always start at the fixed time 00000.Out of curiosity, does that regularly happen? If it was a one-time thing, I'm curious when and why
kevin.cianfarini
09/09/2024, 3:16 PMMark
09/10/2024, 2:06 PMLocalDate
without showing the year? Equivalent of Android’s DateUtils.FORMAT_NO_YEAR
Oliver.O
09/28/2024, 9:19 PMwasmWasi
target support.CLOVIS
10/15/2024, 7:54 PMe: KLIB resolver: Could not find "org.jetbrains.kotlinx:kotlinx-datetime-cinterop-date" in [/…/pedestal, /…/.konan/klib, /…/.konan/kotlin-native-prebuilt-linux-x86_64-2.0.0/klib/common, /…/.konan/kotlin-native-prebuilt-linux-x86_64-2.0.0/klib/platform/linux_x64]
It just started happening on an existing project.
Kotlin 2.0.0
KotlinX.Datetime 0.6.0Raphael TEYSSANDIER
10/23/2024, 9:09 AMAlexandru Gheorghe
11/21/2024, 2:50 PM.toInstant(TimeZone.UTC)
I'm converting it to UTC. I noticed that the time is kept the same. I was expecting it to change to a time in UTC timezone. This creates a disparity between the user creating data in their timezone and expecting it to show up with the same time (when converted back from UTC into system's timezone) however this is not the case as the time is not adjusted. Am I missing something?Daniel Pitts
12/05/2024, 3:07 AMkotlinx.datetime.format.DateTimeFormat
which will correctly parse "an iCalendar format DATE-TIME value in UTC". For example 19000101T000000Z
. ChatGPT and Github Copilot are eager to tell me how to do it with Java, but completely lost with Kotlinx datetime.Alexandru Gheorghe
12/11/2024, 3:47 PMAlexandru Gheorghe
12/14/2024, 10:47 AMClock.System.now().toEpochMilliseconds()
returns time in UTC rather than local time? What was the rationale behind this behaviour?CLOVIS
12/17/2024, 2:33 PMInstant
. For a given TimeZone
(thus I can get a LocalDateTime
), I want to know the very first existing hour of the next day in that timezone.
For example, if I have 23h47 december 17th in France, I want 00h00 december 18th. If 00h00 december 18th doesn't exist for whatever reason, I want the very next time that happens in that timezone, however later it happens to be.
How can I represent this?Joel Denke
12/17/2024, 7:10 PMMatas Lauzadis
12/19/2024, 11:13 PM23:59:60
) which needs to subtract one second (becoming 23:59:59
). I have a function: private fun WithTime.secondOrleapSecond() = alternativeParsing({ second() }) { chars("60") }
. This can parse the leap seconds without crashing, but (understandably) returns 23:59:0
. How can I set seconds = 59
in this case? I found a GitHub issue about leap seconds, there was a hint of a solution but none offered.russhwolf
01/12/2025, 1:17 AMTimeZone.UTC
is not equivalent to TimeZone.of("UTC")
? That's incredibly unintuitive.kevin.cianfarini
01/15/2025, 7:23 PMrob42
01/17/2025, 3:26 PMdave08
01/20/2025, 11:53 AMCLOVIS
02/05/2025, 4:58 PMOk, but, how?is a subclass ofDatePeriod
with zero time components, it represents a difference between two LocalDate values decomposed into date units.DateTimePeriod
LocalDate
doesn't have a -
operator 🤔CLOVIS
02/05/2025, 5:05 PMUtcOffset
doesn't internally rely on Duration
? Looking at the code, my guess is that it was to rely on Java's implementation?hfhbd
02/06/2025, 9:15 AMDmitry Khalanskiy [JB]
02/10/2025, 3:41 PMdawidhyzy
02/17/2025, 8:32 AMpeekandpoke
03/03/2025, 9:30 AMcurioustechizen
03/17/2025, 1:56 PMStylianos Gakis
03/24/2025, 4:05 PM2025-03-24T08:00:00.000001Z
Which indicates that it's in UTC time, hence the Z
afaik
But I may get an instant which is not Z
there, but some other timezone too
Is there a way for me to turn it into a LocalDateTime, but using whatever time-zone the string itself already came in?
So I want to do
Instant
.parse("2025-03-24T08:00:00.000001Z")
.toLocalDateTime(???)
But not sure what I should do for timezone.
The use-case is that my server is giving me a timestamp, and I want to show the date only as-is, so whatever the server had decided already. So if you are in different parts of the world you do not get different results (if I used TimeZone.currentSystemDefault()
) but I also don't want to just default to UTC and potentially change the date that I show if the timestamp was not in UTC.Manuel Lorenzo
03/28/2025, 8:06 PMKotlinx_datetimeLocalDateTime
Robert Jaros
04/14/2025, 12:29 PMkotlinx-datetime
on Kotlin/JS on Windows I have a strange problem with casing. There is a webpack warning and the library is not working correctly (ClassCastException
is thrown):
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\Kotlin-DateTime-library-kotlinx-datetime\kotlinx\datetime\serializers\LocalTimeSerializers.mjs Used by 1 module(s), i. e. javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\Kotlin-DateTime-library-kotlinx-datetime\kotlinx\datetime\localtime.mjs
javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\kotlin-datetime-library-kotlinx-datetime\kotlinx\datetime\serializers\LocalTimeSerializers.mjs Used by 1 module(s), i. e. javascript/esm|C:\Users\kpadarz\Desktop\Wykaz\wykaz2\wykaz\build\js\packages\wykaz\kotlin\kotlin-datetime-library-kotlinx-datetime\kotlinx\datetime\localtime.mjs
kevin.cianfarini
04/29/2025, 1:20 PMval min = LocalTime(hour = 0, minute = 0, second = 0, nanosecond = 0)
val max = LocalTime(hour = 23, minute = 59, second = 59, nanosecond = 999_999_999)
Would there be any interest in accepting a PR that specifies LocalTime.MIN
and LocalTime.MAX
like both Instant and LocalDateTime have?kevin.cianfarini
04/29/2025, 3:19 PMkotlinx.datetime.TimeZone
shouldn’t query the underlying database from the tzdb entry when calling TimeZone.of(String)
. Do you have thoughts?kevin.cianfarini
05/07/2025, 6:43 PMkotlinx.datetime.Clock
. I suspect I should move those to kotlin.time.Clock
? When is kotlinx.datetime.Clock
planned to be removed?