Parsing the output of systemctl status is fragile, and show already gives machine-readable fields.
systemctl show nginx.service -p MainPID --value
systemctl show nginx.service -p ActiveEnterTimestamp --value
-p selects a property and --value prints only its value without the Name= prefix, so it drops straight into a variable: pid=$(systemctl show nginx -p MainPID --value). Without -p, the command prints every property, which is useful to search with grep. A stopped service reports MainPID=0. The same works for --user units. Run systemctl show nginx once to see which property names exist, then pick the ones you need.
Further reading: systemctl manual page