Python -> Arduino -- Date/Time Serial Transfer

I am a new user of Arduino Uno and I was wondering if anyone can help me a bit with either understanding the serial port read() and write( ) transfers I posted and attached most of my code, I am simply trying to use Python's Time and Sleep libraries in order to get the current time and date when I first run my Arduino board however the outfit that I feel I should get by looking online and useing the methods is not coming out right. Any help would be greatly appreciated.
--I need to send 2-4 digits at a time or all and parse it before displaying it on my 16x2 lcd display.
I used gettime.py and dateTest.ino in Arduino. However I am getting a random output that I don't want. Here is the print out
o oo osnT... repeats over and over. I don't understand why it is getting this output though?

---------------------------gettime.py-----------------------

s = serial.Serial('COM3', 9600)
    
timeNow = time.localtime()

month = timeNow.tm_mon
day = timeNow.tm_mday
year = timeNow.tm_year
date = month, " ", day, ", ", year

hour = timeNow.tm_hour
minutes = timeNow.tm_min

while (s.read() != '0'):
    passVal = s.read()
    print s.read()
    if(passVal == -9):
        print "got to while1"
        s.flush()
        s.write(month)
    
    if(passVal == -1):
        print "got to while2"
        s.flush()
        s.write(day)
    
    if(passVal == -2):
        s.flush()
        s.write(year)
    
    if(passVal == -3):
        s.flush()
        s.write(hour)
    
    if(passVal == -4):
        s.flush()
        s.write(minutes)
    
s.close()
print date, " , ", hour, ":", minutes,"\n"

------------------------dateTest.ino------------------------------------

LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
int columns = 16;
int rows = 4;

int minSecsBetweenEmails = 60; // 1 min
String month = "";
String day = "";
String year = "";
String hour = "";
String minutes = "";
long lastSend = -minSecsBetweenEmails * 1000l;
void setup()
{
  
  lcd.begin(rows, columns);
  lcd.clear();
  Serial.begin(9600);
}

void loop()
{
  long now = millis();
    if (now > (lastSend + minSecsBetweenEmails * 1000l))
    {
      Serial.println("READY");
      lastSend = now;
      for(int i = 0; i < Serial.available(); i++){
        if(i <= 2){
          month += Serial.read();
        }
        else if(i <= 4 && i > 2){
          day += Serial.read();
        }
        else if(i <= 8 && i > 4){
          year += Serial.read();
        }
        else{
          break;
        }
      }
     lcd.print(month);
     lcd.print(day);
     lcd.print(year);
     }
    else
    {
      Serial.println("Too soon");
    }
  
  delay(500);
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

gettime.py (883 Bytes)

dateTest.ino (1.21 KB)

  /*if (digitalRead(pirPin) == LOW)
  else if (digitalRead(pirPin) == LOW)
  else if (digitalRead(pirPin) == LOW)
  else if (digitalRead(pirPin) == LOW)*/

WTF? Commenting out garbage doesn't make it any less garbage.

      Serial.println("READY");
      lastSend = now;
      for(int i = 0; i < Serial.available(); i++){

Here seems to be your fundamental misunderstanding. You send a request for data, and expect an immediate response. It doesn't work that way. Looping on a value that can change is not a good idea, either.

Suppose, for instance, that you set the baud rate to 1,000,000,000,000. You can't but, just pretend that you could, and that you got an immediate response of two characters. You read one, so, now there is only one character available. Since i is now 1, and 1 is not less than 1, the body of the loop is skipped.

Use Tools + Auto Format before posting code again.

well the time class lets me find the current time and date and it sends a maximum of 4 intergers. Would i be able to ultimately pick those up through the arduino serial? or would that task be impossible? I feel like i've seen many program do it, however mine of course isn't communicating correctly. I will keep you posted if i do actually find the correct output finally.

well the time class lets me find the current time and date

Yes, it does. IF there is some way for it to know the correct time at the last sync attempt.

and it sends a maximum of 4 intergers.

What? What is this supposed to mean? The Time library doesn't send anything anywhere.

PaulS:

and it sends a maximum of 4 intergers.

What? What is this supposed to mean? The Time library doesn't send anything anywhere.

-meaning the method I call returns an interger with 4 characters (maximum) for the year. ex: 2013

-meaning the method I call returns an interger with 4 characters (maximum) for the year. ex: 2013

It doesn't return the value as a character string, and it doesn't return the value via the serial port, so:

would i be able to ultimately pick those up through the arduino serial?

no.