DCF 77 and Time :how to get the digits of hour and minutes

Hi,
I am 85 years old and a very beginner in programming, but a professional in electronics.
I use a Mega 2560 . I have loaded the DCF- sketch of Thijs Elenbaas and I have connected a Pollin DCF receiver. This all works well, so I get the values of date and time on the console display. Fine !
Now I want to have the separate digits of hour and minutes for my own sketch, but I cannot find the right way to import these values in my own sketch.
Can anyone help me ?

Arie

I have loaded the DCF- sketch of Thijs Elenbaas and I have connected a Pollin DCF receiver.

But we can't see your code.

Now I want to have the separate digits of hour and minutes for my own sketch, but I cannot find the right way to import these values in my own sketch.

If you can print them, you can assign them to variables.

Can anyone help me ?

Without seeing your code? No.

This is the code of the sketch Thys Elenbaas:

#include “Utils.h”
#include “DCF77.h”
#include “Time.h”
using namespace Utils;

#define DCF_PIN 2 // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0 // Interrupt number associated with pin

time_t prevDisplay = 0; // when the digital clock was displayed
time_t time;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);

void setup() {
Serial.begin(9600);
DCF.Start();
setSyncInterval(30);
setSyncProvider(getDCFTime);
// It is also possible to directly use DCF.getTime, but this function gives a bit of feedback
//setSyncProvider(DCF.getTime);

Serial.println(“Waiting for DCF77 time … “);
Serial.println(“It will take at least 2 minutes until a first update can be processed.”);
while(timeStatus()== timeNotSet) {
// wait until the time is set by the sync provider
Serial.print(”.”);
delay(2000);
}
}

void loop()
{
if( now() != prevDisplay) //update the display only if the time has changed
{
prevDisplay = now();
digitalClockDisplay();
};

}

void digitalClockDisplay(){
// digital clock display of the time
Serial.println("");
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");

}

void printDigits(int digits){
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(":");
if(digits < 10)
Serial.print(‘0’);
Serial.print(digits);
}

unsigned long getDCFTime()
{
time_t DCFtime = DCF.getTime();
// Indicator that a time check is done
if (DCFtime!=0) {
Serial.print(“X”);
}
return DCFtime;

Serial.print(hour());

There's the function that gets the hour for instance.

You could just:

int someVariable = hour();

And you'd have the hour in a variable.