Playdate Simulator 1.12.2 and 1.12.3 on Ubuntu Linux.
Given src/main.lua:
import "CoreLibs/object"
print("getTime:")
printTable(playdate.getTime())
print("getGMTTime:")
printTable(playdate.getGMTTime())
function playdate.update()
end
$ pdc src out
$ PlaydateSimulator out
22:41:40: Debug: SimulatorApp::OnInit()
22:41:40: Logging started [2022-08-17T22:41:40]
22:41:40: Logging to [/home/chaos/.Playdate Simulator/Playdate Simulator.log]
22:41:42: SDK: /opt/PlaydateSDK-1.12.3
22:41:42: Release: 1.12.3
22:41:42: cmd line pdx path: out.pdx
22:41:42: Loading: out.pdx
22:41:42: Loading: OK
Expected behavior: The [year]
returned for both calls is 2022
Observed behavior: The [year]
for getTime is 2052
, while for getGMTTime it's 2022
.
This only applies to the PlaydateSimulator; my physical Playdate returns 2022
as expected.
I note that 30 years is also the difference between the traditional Unix epoch of Jan 1 1970 and the Playdate epoch of Jan 1 2000.
Full console output:
22:41:42: SDK: /opt/PlaydateSDK-1.12.3
22:41:42: Release: 1.12.3
22:41:42: cmd line pdx path: out.pdx
22:41:42: Loading: out.pdx
getTime:
{
[day] = 17,
[hour] = 3,
[millisecond] = 458,
[minute] = 41,
[month] = 8,
[second] = 42,
[weekday] = 6,
[year] = 2052,
}
getGMTTime:
{
[day] = 18,
[hour] = 3,
[millisecond] = 458,
[minute] = 41,
[month] = 8,
[second] = 42,
[weekday] = 4,
[year] = 2022,
}
22:41:42: Loading: OK