Arduino MKR 1300 RTC library question

Which library should I use for this board? RTCZero or another?

Also I want to create an alarm that would do something every 1 minute and then send data every 5 minutes how would I go about that?

You can use the RTCZero library for this Board, because it also uses the SAMD21. You can set an alarm with the library. You can look for a reference here for instance: RTCZero power saving tutorial for SAMD21 based boards

So after I uploaded this code:

#include "EmonLib.h"
#include <RTCZero.h>

// Include Emon Library
EnergyMonitor emon1;
EnergyMonitor emon2;
//EnergyMonitor emon3;
// Create an instance

/* Create an rtc object */
RTCZero rtc;

/* Change these values to set the current initial time */
const byte seconds = 0;
const byte minutes = 0;
const byte hours = 0;

/* Change these values to set the current initial date */
const byte day = 17;
const byte month = 12;
const byte year = 18;

void setup()
{
  rtc.begin(); // initialize RTC

  // Set the time
  rtc.setHours(hours);
  rtc.setMinutes(minutes);
  rtc.setSeconds(seconds);

  // Set the date
  rtc.setDay(day);
  rtc.setMonth(month);
  rtc.setYear(year);

  rtc.setAlarmTime(00, 00, 10);
  rtc.enableAlarm(rtc.MATCH_HHMMSS);
  rtc.attachInterrupt(ISR);
  rtc.standbyMode();
  
  Serial.begin(9600);
  analogReadResolution(12);
  emon1.current(1, 57);  
  emon2.current(2, 53);
  /*emon3.current(3, 53);// Current: input pin, calibration.*/
}

void loop()
{
}

void ISR(){
  unsigned long StartTime = millis();
  
  double Irms1 = emon1.calcIrms(600);
  if (Irms1 < 0.3) Irms1 = 0;
  double Watt1 = Irms1 * 230;
  String result1 = "Wh1 = " + String(Watt1) + " , Current1 = "+String(Irms1); 
  Serial.println(result1);
  
  double Irms2 = emon2.calcIrms(600);
  if (Irms2 < 0.3) Irms2 = 0;
  double Watt2 = Irms2 * 230;
  String result2 = "Wh2 = " + String(Watt2) + " , Current2 = "+String(Irms2); 
  Serial.println(result2);

  // Print date...
  print2digits(rtc.getDay());
  Serial.print("/");
  print2digits(rtc.getMonth());
  Serial.print("/");
  print2digits(rtc.getYear());
  Serial.print(" ");

  // ...and time
  print2digits(rtc.getHours());
  Serial.print(":");
  print2digits(rtc.getMinutes());
  Serial.print(":");
  print2digits(rtc.getSeconds());

  Serial.println();

  /*double Irms3 = emon3.calcIrms(600);
  if (Irms3 < 0.3) Irms3 = 0;
  double Watt3 = Irms3 * 230;
  String result3 = "Wh3 = " + String(Watt3) + " , Current3 = "+String(Irms3); 
  Serial.println(result3);
  double kw = (Watt1 + Watt2 + Watt3) / 1000;
  Serial.println(kw);
  
  unsigned long CurrentTime = millis();
  unsigned long ElapsedTime = CurrentTime - StartTime;
  
  Serial.println(ElapsedTime);*/
}


void print2digits(int number) {
  if (number < 10) {
    Serial.print("0"); // print a 0 before if the number is < than 10
  }
  Serial.print(number);
}

Port is gone and I get device not recognized, any idea why this happened? Also, button reset and board change doesn't work (well board change does work but after upload, it's gone too)

As for windows, it says it cannot recognize device.

Edit: Double click reset reset worked lol.

That's a common issue I've encountered too. If you run into anything like that (the device not being recognized), double tap the Reset button on your MKR WAN 1300. The device should be recognizable again by your Computer afterwards.

Thank you, yeah I double tapped, the problem is due to standByMode().