Hi guys, when using ktor's GMTDate, I'm getting th...
# ktor
s
Hi guys, when using ktor's GMTDate, I'm getting this bug:
Copy code
// 10:18:47 4.FEB.2019
// dateRaw: GMTDate = GMTDate(seconds=47, minutes=18, hours=10, dayOfWeek=MONDAY, dayOfMonth=4, dayOfYear=35, month=FEBRUARY, year=2019, timestamp=1549275527000)

val date = dateRaw.toJvmDate()
// date: Date (JVM/Android) — Mon Feb 25 13:07:27 GMT+03:00 2019 (CURRENT DATE)
e
Hi @stanislav, thanks for the notice. Could you file an issue?
s
Yes, but I'm not sure it's an issue, because code provided is working correct.
Copy code
/**
 * Convert to [Date]
 */
fun GMTDate.toJvmDate(): Date = Calendar.getInstance(GMT_TIMEZONE, Locale.ROOT)!!.time!!
So maybe it's more 'naming' issue, than real issue?
Is it supposed to convert given or current date to JVMDate?
👌 1
e
but
dayOfMonth=4 <-> Mon Feb 25
looks ambiguous
s
Yeah, I'm talking about this, that .toJvmDate() converts NOT GIVEN DATE, but CURRENT (from calendar)
Sorry for late response.
e
No problem 🙂 Thanks for the PR