mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-04-05 13:57:36 +03:00
fix: Month save
This commit is contained in:
parent
7c1c299282
commit
587bfdc162
1 changed files with 2 additions and 6 deletions
|
@ -235,11 +235,9 @@ fun bytes5ToDate(buf: ByteArray): DateInstant {
|
||||||
val minute = dw4 and 0x0000000F shl 2 or (dw5 shr 6)
|
val minute = dw4 and 0x0000000F shl 2 or (dw5 shr 6)
|
||||||
val second = dw5 and 0x0000003F
|
val second = dw5 and 0x0000003F
|
||||||
|
|
||||||
// File format is a 1 based month, java Calendar uses a zero based month
|
|
||||||
// File format is a 1 based day, java Calendar uses a 1 based day
|
|
||||||
return DateInstant(Instant.ofEpochMilli(DateTime(
|
return DateInstant(Instant.ofEpochMilli(DateTime(
|
||||||
year,
|
year,
|
||||||
month - 1,
|
month,
|
||||||
day,
|
day,
|
||||||
hour,
|
hour,
|
||||||
minute,
|
minute,
|
||||||
|
@ -294,9 +292,7 @@ fun uuidTo16Bytes(uuid: UUID): ByteArray {
|
||||||
|
|
||||||
fun dateTo5Bytes(dateInstant: DateInstant): ByteArray {
|
fun dateTo5Bytes(dateInstant: DateInstant): ByteArray {
|
||||||
val year = dateInstant.getYear()
|
val year = dateInstant.getYear()
|
||||||
// File format is a 1 based month, java Calendar uses a zero based month
|
val month = dateInstant.getMonth()
|
||||||
val month = dateInstant.getMonth() + 1
|
|
||||||
// File format is a 1 based day, java Calendar uses a 1 based day
|
|
||||||
val day = dateInstant.getDay()
|
val day = dateInstant.getDay()
|
||||||
val hour = dateInstant.getHour()
|
val hour = dateInstant.getHour()
|
||||||
val minute = dateInstant.getMinute()
|
val minute = dateInstant.getMinute()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue