Skip to content

Commit

Permalink
fix: epg timestamp parse rule. #164
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyroid committed Jul 28, 2024
1 parent 8f2cdea commit 9329c2b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions data/src/main/java/com/m3u/data/parser/epg/EpgData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.datetime.TimeZone
import kotlinx.datetime.toInstant
import kotlinx.datetime.toKotlinLocalDateTime
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder

@Immutable
data class EpgData(
Expand Down Expand Up @@ -42,8 +42,12 @@ data class EpgProgramme(
.toInstant(TimeZone.UTC)
.toEpochMilliseconds()

private val EPG_DATE_TIME_FORMATTER = DateTimeFormatter
.ofPattern("yyyyMMddHHmmss Z")
private val EPG_DATE_TIME_FORMATTER = DateTimeFormatterBuilder()
.appendPattern("yyyyMMddHHmmss")
.optionalStart()
.appendPattern(" Z")
.optionalEnd()
.toFormatter()
// .withZone(ZoneId.of("GMT"))
}
}
Expand Down

0 comments on commit 9329c2b

Please sign in to comment.