I’m having trouble with os.time on my actual Android phone. On the simulator, the following lines all work just fine, but for some reason, this specific date is returning nil on my old HTC Droid Incredible (ADR6300) Android phone.
Code:
[lua]
print("Time 1: ", os.time({year=2015, month=3, day=7, hour=2, min=5, sec=42}))
print("Time 2: ", os.time({year=2015, month=3, day=8, hour=2, min=5, sec=42}))
print("Time 3: ", os.time({year=2015, month=3, day=9, hour=2, min=5, sec=42}))
[/lua]
Output from adb logcat:
[lua]
I/Corona (16936): Time 1: 1425722742
I/Corona (16936): Time 2: nil
I/Corona (16936): Time 3: 1425891942
[/lua]
As you can see, the only thing I change between the 3 is the day, and March 8, 2015 should definitely be a valid day. Any ideas what may be wrong here? I’ve tried restarting the phone and re-installing several times. The phone is on the very old 2.3.4 gingerbread OS, so maybe it’s just an old bug that’s since been fixed (I don’t have an easy way of testing that myself). I’ve tried building with Corona 2014.2511 (public release) and the latest daily build from today, 2015.2589. Thanks for any ideas!