Write arrays on EEPROM

Hello,
I am trying to create a little software that write the time that the button was turned on or off.

Example: Every time that someone turns on the switch, the Arduino storage this information and when turns off, the Arduino storage this information again. I am very new in this part of the Arduino, so any help is good. Thanks

i already wrote:

(this first one is just to appear the time when i turned on or off the switch.)

#include <EEPROM.h>

#include <Time.h>
//#include <TimeAlarms.h>

const int buttonPin = 3;
int buttonState = 1;
int coco = 0;

int ledPin = 8;
int memoria = 0;

void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
setTime(8,29,0,24,8,2015); // set time

}

void loop(){

ClockDisplay();

}

void ClockDisplay()
{

buttonState = digitalRead(buttonPin);

//all this are just to, when i turn on the switch the time appears on the //monitor seria

if(buttonState != coco){
coco = 1 - coco;

Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");
Serial.print(day());
PrintDigits(month());
PrintDigits(year());
Serial.println();

}
}

void printDigits(int digits)
{
Serial.print(":");
if(digits < 10)
Serial.print(‘0’);
Serial.print(digits);
}

void PrintDigits(int digits)
{

Serial.print("/");
if(digits < 10)
Serial.print(‘0’);
Serial.print(digits);

}


(This second one is the one that i am trying to save on the EEPROM).

#include <EEPROM.h>

#include <Time.h>
//#include <TimeAlarms.h>

const int buttonPin = 3;
int buttonState = 1;
int coco = 0;

int ledPin = 8;
int memoria = 0;

void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
setTime(8,29,0,24,8,2015);

}

void loop(){

ClockDisplay();

}

void ClockDisplay()
{

buttonState = digitalRead(buttonPin);

if(buttonState != coco){
coco = 1 - coco;

EEPROM.write(memoria, second());
memoria = memoria + 1;

}
}

void printDigits(int digits)
{
Serial.print(":");
if(digits < 10)
Serial.print(‘0’);
Serial.print(digits);
}

void PrintDigits(int digits)
{

Serial.print("/");
if(digits < 10)
Serial.print(‘0’);
Serial.print(digits);

}

Google is your friend. I just tried: "Arduino array storage to EEPROM" and got 105,000 hits. Have you read all of those before posting here?

Yeah, i read, but i cant understand how i do this, they dont show how to save an array like i am saying...

OK, then show us what you have written. Make sure you read the two posts at the top of this Forum by Nick Gammon first, especially the part on using code tags when posting your source code.

Ok, i wrote on my first question

Ok, the first one compiles but the second one does not compile because of syntax errors. Which are you wanting us to look at? If the first, why post the second? Fix the errors and repost it. Do NOT edit a prior post without marking it with an EDIT at the start of the edit.

Ok, i wrote right now, the first one is just showing on the Serial Monitor when the switch turned on and off, the second one, i want to instead of showing on the Serial monitor, the Arduino storage this information on the EEPROM, and then, after 15 minutos, for example, i read when all the switch was turned on and off.