ktorio / ktor

Framework for quickly creating connected applications in Kotlin with minimal effort
https://ktor.io
Apache License 2.0
12.97k stars 1.06k forks source link

Time instantiated as GMT, then uses UTC #1114

Closed m1st3rnutso closed 5 years ago

m1st3rnutso commented 5 years ago

Ktor Version

1.2.0-rc2

Ktor Engine Used(client or server and name)

Netty

JVM Version, Operating System and Relevant Context

11.0.2, Windows 10 Pro 64 bit

Feedback

https://github.com/ktorio/ktor/blob/1e29f25545ec6e366426e1bdfa682d5072246f48/ktor-server/ktor-server-core/jvm/src/io/ktor/features/DefaultHeaders.kt#L24

The time is initially GMT upon instantiation, but then becomes UTC when now() is called. Why isn't time instantiated using the now() method?

Now() Method: https://github.com/ktorio/ktor/blob/1e29f25545ec6e366426e1bdfa682d5072246f48/ktor-server/ktor-server-core/jvm/src/io/ktor/features/DefaultHeaders.kt#L47

But then the now().toHttpDateString() forces back to GMT? https://github.com/ktorio/ktor/blob/1e29f25545ec6e366426e1bdfa682d5072246f48/ktor-server/ktor-server-core/jvm/src/io/ktor/features/DefaultHeaders.kt#L61

Looking for some clarification on inconsistent time zone usage.

e5l commented 5 years ago

Hi @m1st3rnutso, thanks for the report. What do you mean by time zone change? https://www.timeanddate.com/time/gmt-utc-time.html https://www.timeanddate.com/time/aboututc.html

e5l commented 5 years ago

Closed. Please reopen if the problem is active.