Getting the correct time with GSM.getTime();

The GSM library has a getTime function that should return the number of seconds since 1 January 1970.
MKRGSM - Arduino Reference.

When I run it I get a number such as:

1072916002

Using a unix epoch converter this is Thursday, 1 January 2004 00:13:22. The current unix epoch time is 1573547448.

How can I get the correct time?

#include <MKRGSM.h>
GSM gsmAccess;
GPRS gprs;

#include "secrets.h"
const char pinnumber[]     = SECRET_PINNUMBER;
const char gprs_apn[]      = SECRET_GPRS_APN;
const char gprs_login[]    = SECRET_GPRS_LOGIN;
const char gprs_password[] = SECRET_GPRS_PASSWORD;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
	while (!Serial);
	if (gsmAccess.status() != GSM_READY || gprs.status() != GPRS_READY) {
    connectGSM();
  }
}

void loop() {
  // put your main code here, to run repeatedly:
	Serial.println(getTime());
	delay(1000);
}

unsigned long getTime() {
  // get the current time from the cellular module
  return gsmAccess.getTime();
}

void connectGSM() {
  Serial.println("Attempting to connect to the cellular network");

  while ((gsmAccess.begin(pinnumber) != GSM_READY) ||
         (gprs.attachGPRS(gprs_apn, gprs_login, gprs_password) != GPRS_READY)) {
    // failed, retry
    Serial.print(".");
    delay(1000);
  }

  Serial.println("You're connected to the cellular network");
  Serial.println();
}

Unfortunately i also have the same problem, but currently no solution.

Levin

Which network provider do you use? As far as I found out, my provider doesn't support the GSM time signal. I will try NTP synchronization of the RTC.

Same issue here. would love to know more info. Although the time does change and increase. so its just under 15 years off. an offset could be used I suppose if this is all we get.

What provider are you using. be good to get a list of supported providers if this is truly the case.