Need help with two errors

Auto Format your code in the IDE

I can't actually see where the getTimeDate() function is defined in the code.

If this is meant to be it

//Function to separate time and date from formattedDate string and assign to variables
  getTimeDate(yearval, monthval, dayval, hourval, minuteval, secondval)
  {
etc

then it has no return type and the parameters do not have data types specified. Mind you, as they are global variables they don't need to be passed to the function anyway.
Moreover, after the Auto Format the function definition should start on the left margin and it doesn't. This strongly suggests that there is at least one } missing somewhere before there or that those lines are inside another function. Where does loop() end ?