Shift registers displaying wrong number yet serial is correct

i have a project clock i have been working on, and built a library (bad one) for my seven segments using 4 shift register. everything works the way i want, but when displaying the year, it reads 2023 instead of 2024 and i cannot figure out why.

#include "SegDisplay.h"
#include "RTClib.h"

RTC_DS3231 rtc;

SegDisplay SegDisplay(D6,D8,D7);  //D6,D7,D8 data clock latch

const int dot1 = D0;                //colon dot  D0



//------------------------ Main Setup -----------------------------------------//
void setup(){
  Serial.begin(115200);
  pinMode (dot1, OUTPUT); 
  #ifndef ESP8266
  while (!Serial); // wait for serial port to connect. Needed for native USB
  #endif
  
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    Serial.flush();
    while (1) delay(10);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, let's set the time!");
    // When time needs to be set on a new device, or after a power loss, the
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }

  // When time needs to be re-set on a previously configured device, the
  // following line sets the RTC to the date & time this sketch was compiled
  // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  // This line sets the RTC with an explicit date & time, for example to set
  // January 21, 2014 at 3am you would call:
  // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
  
//--------------------------- Loop - display time and date from NTP if connected ---------------------------------------------//


void loop(){
  DateTime now = rtc.now();

  SegDisplay.updateDisplay(now.twelveHour(),now.twelveHour(),now.minute(),now.minute());
  Serial.print(now.hour());
  Serial.print(":");
  Serial.print(now.minute());
  Serial.print(":");
  Serial.println(now.second());
  delay(1000);
  
  SegDisplay.DisplayDate(now.day(),now.day(),now.month(),now.month());
  Serial.print(now.day());
  Serial.print("-");
  Serial.print(now.month());
  Serial.print("-");
  Serial.println(now.year());
  delay(1000);
  
  SegDisplay.DisplayYear(now.year());
  delay(1000);
  
  digitalWrite(dot1, HIGH);
  delay(400);
  digitalWrite(dot1, LOW);
  delay(400);
}

library h.file

#include "Arduino.h"

#ifndef SegDisplay_h
#define SegDisplay_h



class SegDisplay
{
  public:
  unsigned ShiftRegisters;
  SegDisplay(uint8_t DataPin, uint8_t ClockPin, uint8_t LatchPin);
  void sendSerialData(byte registerCount, byte *pValueArray);
  void updateDisplay(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4);
  void clearDisplay();
  void blinkDisplay();
  void DisplayTemp(uint8_t data1, uint8_t data2);
  void DisplayHumid(uint8_t data1, uint8_t data2);
  void DisplayDate(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4);
  void DisplayYear(uint8_t data1);

  private:
  uint8_t _DataPin;
  uint8_t _ClockPin;
  uint8_t _LatchPin;
  uint8_t _data1;
  uint8_t _data2;
  uint8_t _data3;
  uint8_t _data4;
  
};

#endif

library cpp.file

#include "Arduino.h"
#include "SegDisplay.h"
#define ShiftRegisters 4
  

SegDisplay::SegDisplay(uint8_t DataPin, uint8_t ClockPin, uint8_t LatchPin){
  
  pinMode(DataPin, OUTPUT);
  pinMode(ClockPin, OUTPUT);
  pinMode(LatchPin, OUTPUT);

  _DataPin = DataPin;
  _ClockPin = ClockPin;
  _LatchPin = LatchPin;
}

void SegDisplay::updateDisplay(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4){
  byte RegArray [ShiftRegisters];
  byte Digits [10];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;

  _data1 = data1;
  _data2 = data2;
  _data3 = data3;
  _data4 = data4;

  RegArray[0] = Digits[_data1 / 10];
  RegArray[1] = Digits[_data2 % 10];
  RegArray[2] = Digits[_data3 / 10];
  RegArray[3] = Digits[_data4 % 10];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::clearDisplay(){
  byte RegArray [ShiftRegisters];
  RegArray[0] = 0;
  RegArray[1] = 0;
  RegArray[2] = 0;
  RegArray[3] = 0;
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}
void SegDisplay::blinkDisplay(){
  byte RegArray [ShiftRegisters];
  byte Digits [2];
  Digits [8] = 8 + 4 + 2 + 64 + 32 + 1 + 16;
  Digits [99] = 0;
  
  for(int i=0;i<5;i++){
    RegArray[0] = Digits[8];
    RegArray[1] = Digits[8];
    RegArray[2] = Digits[8];
    RegArray[3] = Digits[8];
    SegDisplay::sendSerialData(ShiftRegisters, RegArray);
    delay(200);

    RegArray[0] = Digits[99];
    RegArray[1] = Digits[99];
    RegArray[2] = Digits[99];
    RegArray[3] = Digits[99];
    SegDisplay::sendSerialData(ShiftRegisters, RegArray);
    delay(200);
  }
}

void SegDisplay::DisplayTemp(uint8_t data1, uint8_t data2){
  byte RegArray [ShiftRegisters];
  byte Digits [14];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;
  Digits [95] = 16 + 32 + 8 + 1;       // Degree dot
  Digits [96] = 16 + 1 + 4 + 2;      // Capital C
  Digits [97] = 4 + 8;              //  r, 80
  Digits [98] = 1 + 4 + 8 + 64;      //  h, 116

  _data1 = data1;
  _data2 = data2;

  RegArray[0] = Digits[data1 / 10];
  RegArray[1] = Digits[data2 % 10];
  RegArray[2] = Digits[95];
  RegArray[3] = Digits[96];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::DisplayHumid(uint8_t data1, uint8_t data2){
  byte RegArray [ShiftRegisters];
  byte Digits [14];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;
  Digits [95] = 16 + 32 + 8 + 1;       // Degree dot
  Digits [96] = 16 + 1 + 4 + 2;      // Capital C
  Digits [97] = 4 + 8;              //  r, 80
  Digits [98] = 1 + 4 + 8 + 64;      //  h, 116
  
  _data1 = data1;
  _data2 = data2;

  RegArray[0] = Digits[data1 / 10];
  RegArray[1] = Digits[data2 % 10];
  RegArray[2] = Digits[97];
  RegArray[3] = Digits[98];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::DisplayDate(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4){
  byte RegArray [ShiftRegisters];
  byte Digits [10];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;

  _data1 = data1;
  _data2 = data2;
  _data3 = data3;
  _data4 = data4;
 
  RegArray[0] = Digits[data1 / 10];
  RegArray[1] = Digits[data2 % 10];
  RegArray[2] = Digits[data3 / 10];
  RegArray[3] = Digits[data4 % 10];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::DisplayYear(uint8_t data1){
  byte RegArray [ShiftRegisters];
  byte Digits [10];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;

  _data1 = data1;
  
  RegArray[0] = Digits[(data1 % 1000)/100];
  RegArray[1] = Digits[data1 / 1000];
  RegArray[2] = Digits[data1 / 100];
  RegArray[3] = Digits[(data1 % 100)/ 10];
  
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::sendSerialData (byte registerCount, byte *pValueArray) {
  // Signal to the 595s to listen for data
  digitalWrite (_LatchPin, LOW);

  for (byte reg = registerCount; reg > 0; reg--)
  {
    byte value = pValueArray [reg - 1];

    for (byte bitMask = 128; bitMask > 0; bitMask >>= 1)
    {
      digitalWrite (_ClockPin, LOW);
      digitalWrite (_DataPin, value & bitMask ? HIGH : LOW);
      digitalWrite (_ClockPin, HIGH);
    }
  }
  // Signal to the 595s that I'm done sending
  digitalWrite (_LatchPin, HIGH);
}  // sendSerialData

any help would be much appreciated. and before you ask, yes i have tried using other libraries, but i do not understand what parts do what, my code I can understand.

i should add that this is on a Wemos D1 mini R4 with RTC DS3231 and i was using a DHT11 but have switched to a DHT22 recently.

Is the correct value of year printed on the Serial monitor ?

yes! it is correct

 byte Digits [10];
Digits [99] = 0;

You are writing data outside of the array

i don't quite follow, should:
byte Digits [10]
be :
byte Digits[11]
to include the Digits[99] = 0; ?

No

byte Digits [10]

allocates memory for 10 array locations numbered 0 to 9

In order to use Digits[99] you need to declare the array as having 100 locations

byte Digits [100]

They will be numbered 0 to 99

oh i get it.
strange though, everything works. minus displaying the right year
Digits[99] is just an "OFF" digit, it isn't really needed.

i figured out where things are going wrong.
it's this part

RegArray[0] = Digits[(data1 % 1000)/100];
  RegArray[1] = Digits[data1 / 1000];
  RegArray[2] = Digits[data1 / 100];
  RegArray[3] = Digits[(data1 % 100) / 10];

i worked it out, the data calculations do not work in the library, they only work in the loop. i don't know why

main file

#include "SegDisplay.h"
#include "RTClib.h"

RTC_DS3231 rtc;

SegDisplay SegDisplay(D6,D8,D7);  //D6,D7,D8 data clock latch

const int dot1 = D0;                //colon dot  D0



//------------------------ Main Setup -----------------------------------------//
void setup(){
  Serial.begin(115200);
  pinMode (dot1, OUTPUT); 
  #ifndef ESP8266
  while (!Serial); // wait for serial port to connect. Needed for native USB
  #endif
  
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    Serial.flush();
    while (1) delay(10);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, let's set the time!");
    // When time needs to be set on a new device, or after a power loss, the
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }

  // When time needs to be re-set on a previously configured device, the
  // following line sets the RTC to the date & time this sketch was compiled
  // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  // This line sets the RTC with an explicit date & time, for example to set
  // January 21, 2014 at 3am you would call:
  // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
  
//--------------------------- Loop - display time and date from NTP if connected ---------------------------------------------//


void loop(){
  DateTime now = rtc.now();

  SegDisplay.updateDisplay(now.twelveHour(),now.twelveHour(),now.minute(),now.minute());
  Serial.print(now.hour());
  Serial.print(":");
  Serial.print(now.minute());
  Serial.print(":");
  Serial.println(now.second());
  delay(2000);
  
  /*
  SegDisplay.DisplayDate(now.day(),now.day(),now.month(),now.month());
  Serial.print(now.day());
  Serial.print("-");
  Serial.print(now.month());
  Serial.print("-");
  Serial.println(now.year());
  delay(1000);
  */

  int Y1;
  int Y2;
  int Y3;
  int Y4;

  Y1 = now.year()/1000;
  Y2 = (now.year()%1000)/100;
  Y3 = (now.year()%100)/10;
  Y4 = now.year()%10;
  
  SegDisplay.DisplayYear(Y1,Y2,Y3,Y4);
  Serial.print("Digit 1 : ");
  Serial.println(Y1);
  Serial.print("Digit 2 : ");
  Serial.println(Y2);
  Serial.print("Digit 3 : ");
  Serial.println(Y3);
  Serial.print("Digit 4 : ");
  Serial.println(Y4);
  Serial.println(now.year());
  delay(2000);

  
}

cpp.file

#include "Arduino.h"
#include "SegDisplay.h"
#define ShiftRegisters 4
  

SegDisplay::SegDisplay(uint8_t DataPin, uint8_t ClockPin, uint8_t LatchPin){
  
  pinMode(DataPin, OUTPUT);
  pinMode(ClockPin, OUTPUT);
  pinMode(LatchPin, OUTPUT);

  _DataPin = DataPin;
  _ClockPin = ClockPin;
  _LatchPin = LatchPin;
}

void SegDisplay::updateDisplay(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4){
  byte RegArray [ShiftRegisters];
  byte Digits [11];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;

  _data1 = data1;
  _data2 = data2;
  _data3 = data3;
  _data4 = data4;

  RegArray[0] = Digits[_data1 / 10];
  RegArray[1] = Digits[_data2 % 10];
  RegArray[2] = Digits[_data3 / 10];
  RegArray[3] = Digits[_data4 % 10];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::clearDisplay(){
  byte RegArray [ShiftRegisters];
  RegArray[0] = 0;
  RegArray[1] = 0;
  RegArray[2] = 0;
  RegArray[3] = 0;
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}
void SegDisplay::blinkDisplay(){
  byte RegArray [ShiftRegisters];
  byte Digits [2];
  Digits [8] = 8 + 4 + 2 + 64 + 32 + 1 + 16;
  Digits [99] = 0;
  
  for(int i=0;i<5;i++){
    RegArray[0] = Digits[8];
    RegArray[1] = Digits[8];
    RegArray[2] = Digits[8];
    RegArray[3] = Digits[8];
    SegDisplay::sendSerialData(ShiftRegisters, RegArray);
    delay(200);

    RegArray[0] = Digits[99];
    RegArray[1] = Digits[99];
    RegArray[2] = Digits[99];
    RegArray[3] = Digits[99];
    SegDisplay::sendSerialData(ShiftRegisters, RegArray);
    delay(200);
  }
}

void SegDisplay::DisplayTemp(uint8_t data1, uint8_t data2){
  byte RegArray [ShiftRegisters];
  byte Digits [15];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;
  Digits [95] = 16 + 32 + 8 + 1;       // Degree dot
  Digits [96] = 16 + 1 + 4 + 2;      // Capital C
  Digits [97] = 4 + 8;              //  r, 80
  Digits [98] = 1 + 4 + 8 + 64;      //  h, 116

  _data1 = data1;
  _data2 = data2;

  RegArray[0] = Digits[data1 / 10];
  RegArray[1] = Digits[data2 % 10];
  RegArray[2] = Digits[95];
  RegArray[3] = Digits[96];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::DisplayHumid(uint8_t data1, uint8_t data2){
  byte RegArray [ShiftRegisters];
  byte Digits [15];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;
  Digits [95] = 16 + 32 + 8 + 1;       // Degree dot
  Digits [96] = 16 + 1 + 4 + 2;      // Capital C
  Digits [97] = 4 + 8;              //  r, 80
  Digits [98] = 1 + 4 + 8 + 64;      //  h, 116
  
  _data1 = data1;
  _data2 = data2;

  RegArray[0] = Digits[data1 / 10];
  RegArray[1] = Digits[data2 % 10];
  RegArray[2] = Digits[97];
  RegArray[3] = Digits[98];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::DisplayDate(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4){
  byte RegArray [ShiftRegisters];
  byte Digits [11];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;

  _data1 = data1;
  _data2 = data2;
  _data3 = data3;
  _data4 = data4;
 
  RegArray[0] = Digits[data1 / 10];
  RegArray[1] = Digits[data2 % 10];
  RegArray[2] = Digits[data3 / 10];
  RegArray[3] = Digits[data4 % 10];
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::DisplayYear(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4){
  byte RegArray [ShiftRegisters];
  byte Digits [11];
  
  Digits [0] = 16 + 32 + 64 + 2 + 4 + 1;                          
  Digits [1] = 32 + 64;
  Digits [2] = 16 + 32 + 8 + 4 + 2;
  Digits [3] = 16 + 32 + 8 + 64 + 2;
  Digits [4] = 1 + 8 + 32 + 64;
  Digits [5] = 16 + 1 + 8 + 64 + 2;
  Digits [6] = 16 + 1 + 4 + 2 + 64 + 8;
  Digits [7] = 16 + 32 + 64;
  Digits [8] = 2 + 64 + 32 + 16 + 1 + 8 + 4;
  Digits [9] = 2 + 64 + 32 + 16 + 1 + 8;
  Digits [99] = 0;

  _data1 = data1;
  _data2 = data2;
  _data3 = data3;
  _data4 = data4;
  
  
  RegArray[0] = Digits[data1];
  RegArray[1] = Digits[data2];
  RegArray[2] = Digits[data3];
  RegArray[3] = Digits[data4];
  
  
  SegDisplay::sendSerialData(ShiftRegisters, RegArray);
}

void SegDisplay::sendSerialData (byte registerCount, byte *pValueArray) {
  // Signal to the 595s to listen for data
  digitalWrite (_LatchPin, LOW);

  for (byte reg = registerCount; reg > 0; reg--)
  {
    byte value = pValueArray [reg - 1];

    for (byte bitMask = 128; bitMask > 0; bitMask >>= 1)
    {
      digitalWrite (_ClockPin, LOW);
      digitalWrite (_DataPin, value & bitMask ? HIGH : LOW);
      digitalWrite (_ClockPin, HIGH);
    }
  }
  // Signal to the 595s that I'm done sending
  digitalWrite (_LatchPin, HIGH);
}  // sendSerialData

and h.file

#include "Arduino.h"

#ifndef SegDisplay_h
#define SegDisplay_h



class SegDisplay
{
  public:
  unsigned ShiftRegisters;
  SegDisplay(uint8_t DataPin, uint8_t ClockPin, uint8_t LatchPin);
  void sendSerialData(byte registerCount, byte *pValueArray);
  void updateDisplay(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4);
  void clearDisplay();
  void blinkDisplay();
  void DisplayTemp(uint8_t data1, uint8_t data2);
  void DisplayHumid(uint8_t data1, uint8_t data2);
  void DisplayDate(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4);
  void DisplayYear(uint8_t data1, uint8_t data2, uint8_t data3, uint8_t data4);

  private:
  uint8_t _DataPin;
  uint8_t _ClockPin;
  uint8_t _LatchPin;
  uint8_t _data1;
  uint8_t _data2;
  uint8_t _data3;
  uint8_t _data4;
  
};

#endif

it works now and displays the right year. now i just have to figure out why it won't calculate in the library.

From your .cpp file

byte Digits [11];
Digits [99] = 0;

Does this look familiar ?

Or this

byte Digits [15];
  Digits [99] = 0;
  Digits [95] = 16 + 32 + 8 + 1;       // Degree dot
  Digits [96] = 16 + 1 + 4 + 2;      // Capital C
  Digits [97] = 4 + 8;              //  r, 80
  Digits [98] = 1 + 4 + 8 + 64;      //  h, 116

I don’t have 100 digits, the number [99] is just an allocation number for the digit I want the code to display according to the character call. 0-9 digits are for the code to display the input from “data” value. 95 to 99 are for characters. Hence why temperature and humidity display have:
Byte digits [15]
That’s 0-9 digits (10 digits total), 4 character digits and 1 “all segments off” digit

How many more times ?

When you use

 Digits [99] = 0;

you are storing a value in the one hundredth position in the Digits array but you have not declared the array as having that many positions

Suppose you had a row of 15 pigeonholes for mail and I asked you to put an envelope in the one hundredth position, where would you put it ?

I understand what you are saying. What i am trying to say is that i am only initialising 10 digits, i may be declaring 100, but only 10 are being initialised. All others are simply void/unused.
I could change it to Digits[10] instead of Digits[99]. But I don’t need to as it causes no issues.

It seems to be a global misunderstanding on your side.

Please try to understand - if you declared an array Digits[10], you cant use elements with an index more than 9!

So, if you need only 15 characters, place it in cells Digits[0] - Digits[14].

Why did you place anything to Digits[95] or 99…?

That is the point. You are not declaring an array with 100 positions but you are trying to use the one hundredth position

You seem very certain of that, and even if it is true, then what you are doing is wrong

Please, get to grips with how arrays work and use them properly

It seems that you think that element indices are nothing more than labels. And if you declared an array of ten elements and use only ten elements, then the indices can be anything, for example 1, 2, 3, 5, 122, 1234... - the main thing is that the number of elements does not exceed the declared ten

This is absolutely false. Indexes in an array can ONLY go in a row. And the index is not just a label - it is an address.

This is where i got the code from, i only edited after it was explained to me how it all worked.
There was no need to berate me about something i don’t fully understand when my original question was completely ignored.

Not true

You have an obvious mistake in your sketch. This mistake cannot be ignored when looking for the cause of your problem as your mistake results in behaviour that cannot be predicted