Skip to content

[OffsetDateTime.format] Different result between robolectric and emulator #7910

@likai79511

Description

@likai79511

Description

When i execute OffsetDateTime.format, different results will occur between Robolectric and Device/Emulator.

Steps to Reproduce

@Test
fun test() {
    Locale.setDefault(Locale("en", "AU"))

    val time = OffsetDateTime.parse("2023-01-01T10:00:00Z")
    val formatter = DateTimeFormatter.ofPattern("d MMM yyyy")

    println("FINGERPRINT: ${Build.FINGERPRINT}\nresult:${time.format(formatter)}")
}
Robolectric device/emulator
image image

Robolectric : 1 Jan. 2023 (with a ".")
Device/Emulator: 1 Jan 2023

Robolectric & Android Version

org.robolectric:robolectric:4.9.2
junit:junit:4.13.2

Link to a public git repo demonstrating the problem:

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