Initially it returns 2038-01-19 14:14:07 (UTC+11)
Then, (when the GPS settles down) I get the correct time, but a date that's 20 years in the past.
Today, 2017-01-26, it's giving me 1997-01-27 but with a correct time (UTC+11).
As I said, it works fine on the emulator.
Before I post a bug report, could I ask for an opinion from the forum please?
function onShow() {
Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:GPSData));
}
// Update the view
function onUpdate(dc) {
dc.clear();
var timestruct = Gregorian.info((new Time.Moment(timeSecs )), Time.FORMAT_SHORT);
formattedReportTime = timestruct.year +"-"+
timestruct.month.format("%02u") +"-"+
timestruct.day.format("%02u") +"\n"+
timestruct.hour.format("%02u")
+ ":" + timestruct.min.format("%02u")
+ ":" + timestruct.sec.format("%02u");
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_WHITE);
dc.drawText(70, 45, Graphics.FONT_SYSTEM_MEDIUM,formattedReportTime, Graphics.TEXT_JUSTIFY_CENTER);
}
function GPSData(positionInfo){
timeSecs = positionInfo.when.value();//in whole seconds
Ui.requestUpdate(); // display new data fields
}