Best -
Generate a one shot pulse every second off of the real time clock (RTC) in the PLC (if it has one).
Second-best - Use an external device, to generate a one second clock pulse, feed it to the PLC as an input, use that input to generate a one-shot pulse every second.
Third-best - Use the most accurate timer in the PLC to generate a 1 second pulse.
COMMON LOGIC TO ALL OF THE ABOVE:
Whenever the motor is running, and you get that pulse, add 1 to a register.
Do the math to break down the total seconds count into minutes, hours, days, whatever.
Deal properly with rollover's in the accumulator register.
Do NOT use a Floating point or 'Real' type register to maintain the seconds count.
Look up "Totalizers".
See the links in my sig as well.