Skip to content

set hours of LocalDateTime #223

Closed as not planned
Closed as not planned
@periva101

Description

@periva101

let's say that we have

val nowLocalDateTime = Clock.System.now()
.toLocalDateTime(TimeZone.currentSystemDefault())

I want to set the hours after getting the current LocalDateTime to 10 am .
in java we used

val pickupCalendar =
Calendar.getInstance().apply {
add(Calendar.DATE, 2)
this[Calendar.HOUR_OF_DAY] = 10
this[Calendar.MINUTE] = 0
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions