printing problem

Hi everyone,

I am working on a project that registered time and date on SD card once anyone using his fingerprint in his phone.

The problem here is when I want to print the time or date, it shows just “0” when the time or date is less than 10 because it starts with 0 such as time 08:05:22 , date 05/02/2014

Is there any solution? Here is my code

#define CUSTOM_SETTINGS
#define INCLUDE_FINGERPRINT_SCANNER_SHIELD
#define INCLUDE_BUZZER_SHIELD
#define INCLUDE_TERMINAL_SHIELD
#define INCLUDE_CLOCK_SHIELD

#define CS_SD 4

#include <OneSheeld.h>
#include <SPI.h> // for SD card module
#include <SD.h> // for the SD card

File myFile;

int hour, minute, second, day, month, year;



void setup () 
{
  OneSheeld.begin();
  // Init Serial port
  while (!Serial); // for Leonardo/Micro/Zero

  // Init SPI bus
  SPI.begin();

  // Setup for the SD card
  Terminal.print("Initializing SD card...");
  if (!SD.begin(CS_SD)) {
    Terminal.println("initialization failed!");
    return;
  }
  Terminal.println("initialization done.");
  
  Clock.queryDateAndTime();
}

void loop ()
{
  
  hour = Clock.getHours();
  minute = Clock.getMinutes();
  second = Clock.getSeconds(); 
  day = Clock.getDay();
  month = Clock.getMonth();
  year = Clock.getYear();
  


  
  if(FingerprintScanner.isNewFingerScanned() && FingerprintScanner.isVerified())
  {
   Buzzer.buzzOn();
   delay(2000);
   Buzzer.buzzOff();
  
   Terminal.println(hour);
   Terminal.println(minute);
   Terminal.println(second);
   Terminal.println(day);
   Terminal.println(month);
   Terminal.println(year);
  }
}

Usually the problem is that for values under 10, we need to print an extra 0 to get things lined up by printing the leading 0. (So it wants to print 8:8:8 but we force 08:08:08.)

But are you saying that Clock.gethours() puts only the 0 into the hour variable?

it shows just "0" when the time or date is less than 10 because it starts with 0

If there's a value in hour, even less than 10, it should still print 3 or 6 or 9 or whatever, and we would normally have to force 03 or 06 or 09.

Yes sir, it prints 0 rather the real time, only the number appeared in 1Sheeld terminal is the seconds.

I have no idea what 1sheeld and Terminal are, but what happens if you do a normal Serial.println() to the IDE monitor?