ie Your code and any error messages should always be placed between code tags. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis.
They can also be added manually:-
[code]Paste your code here[/code]
It will appear in a block like this
It's still not too late to edit your post and do this. You'll make potential helpers much happier.
If you need it for printing different time and date from UNIX format, and not a fixed time and date, this could maybe be helpfull
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 rtc;
char daysOfTheWeek[7][12] = {"Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"};
void setup () {
pinMode (A8,OUTPUT); // Power for RTC
digitalWrite(A8,LOW); // Power for RTC
pinMode (A9,OUTPUT); // Power for RTC
digitalWrite(A9,HIGH); // Power for RTC
Serial.begin(115200);
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1); //Halt
}
}
void loop () {
DateTime now = rtc.now();
printDate(now,"A");
Serial.println();
printDate(now,"L");
Serial.println();
printDate(now,"M");
Serial.println();
printDate(now,"S");
Serial.println();
printDate(now,0);
Serial.println();
delay(10000);
}
void printDate(DateTime TimeBuffer, const char *type){;
// unixtime, type All Long Medium Short
if(type == "A"){
Serial.print(daysOfTheWeek[TimeBuffer.dayOfTheWeek()]);
Serial.print(" ");
}
if(type == "A" or type == "L" or type == "M" or type == "S"){
Serial.print(TimeBuffer.year());
Serial.print('-');
Serial.print(formatTimeDigits(TimeBuffer.month()));
Serial.print('-');
Serial.print(formatTimeDigits(TimeBuffer.day()));
}
if(type == "A" or type == "L" or type == "M"){
Serial.print(" ");
Serial.print(formatTimeDigits(TimeBuffer.hour()));
Serial.print(':');
Serial.print(formatTimeDigits(TimeBuffer.minute()));
}
if(type == "A" or type == "L"){
Serial.print(':');
Serial.print(formatTimeDigits(TimeBuffer.second()));
}
// Serial.print("Format NOT selected");
} //printDate End
String formatTimeDigits(int num){
char strOut[3];
strOut[0] = '0' + (num / 10);
strOut[1] = '0' + (num % 10);
strOut[2] = '\0';
return strOut;
} // formatTimeDigits