Chips with RTC and in-core clocks

Arduino Due and Zero may have built-in RTC in the chip itself. Is it possible to implement the time() function on those devices to allow for integral RTC access?

Something like this, an excerpt from my STM32 core project, which also have built-in RTC and backup battery:

#include <time.h>

bool state = false;

void setup(void)
{
	Serial.begin(115200);
	pinMode(14, OUTPUT);
	digitalWrite(14, state);
	Serial.println("Ready.");

	Serial.print("Vcc: ");
	Serial.print(analogReadVcc());
	Serial.println("mV");
}

void loop(void)
{
	time_t t = time(NULL);
	struct tm *tm = localtime(&t);
	char buf[50];
	strftime(buf, 50, "%F %T", tm);

	Serial.print("Now: ");
	Serial.println(buf);

	state = !state;
	digitalWrite(14, state);
	delay(1000);
}