Unsigned long multiplication

I am trying to Read from a file the last temperature with the epoch time in one of the values.

The endpoint I am sending the data to needs millisecond in the time stamp.

It was my hope that I could just multiple the epoch time by 1000L and it would work but to no avail.

 String line = f.readStringUntil('\n');
        Serial.println(line);
        // float t =  line.toInt();
        String tempval = getValue(line, ',', 0);
        tempval.trim();
        String tsval = getValue(line, ',', 1);
        tsval.trim();
        Serial.println("tsval:" + tsval);
        unsigned long ts = tsval.toInt();
        unsigned long y = 1000L;
        unsigned long tsy = ts*1000L;
        Serial.println("Temp:" + tempval);
        Serial.println("ts:" + String(tsy));

OutPut:

79.57,1551806608

tsval:1551806608
Temp:79.57
ts:1323414144

The GetValue function might need some edits as well, but i couldn’t figure out how to split the saved record into a Float and a Long

String getValue(String data, char separator, int index)
{
  int found = 0;
  int strIndex[] = { 0, -1 };
  int maxIndex = data.length() - 1;

  for (int i = 0; i <= maxIndex && found <= index; i++) {
    if (data.charAt(i) == separator || i == maxIndex) {
      found++;
      strIndex[0] = strIndex[1] + 1;
      strIndex[1] = (i == maxIndex) ? i + 1 : i;
    }
  }
  return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}

You can try uint64_t instead of unsigned long.

Or (probably faster), just add 3 zeroes as text instead of multiplying.

Added three zeros and kept it as a string. THANK YOU!