1package com.parseable.android.data
3import java.time.Instant
5import java.time.ZonedDateTime
6import java.time.format.DateTimeFormatter
8private val displayFormatter = DateTimeFormatter.ofPattern("MMM dd HH:mm:ss.SSS")
10fun formatTimestamp(raw: String): String {
12 val instant = Instant.parse(raw)
13 val local = ZonedDateTime.ofInstant(instant, ZoneId.systemDefault())
14 local.format(displayFormatter)
15 } catch (_: Exception) {
16 // Try alternate format with +00:00 suffix
18 val normalized = raw.replace("+00:00", "Z")
19 val instant = Instant.parse(normalized)
20 val local = ZonedDateTime.ofInstant(instant, ZoneId.systemDefault())
21 local.format(displayFormatter)
22 } catch (_: Exception) {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list