Obtain p-values from t-values

I used Tobit regression and wanted to test if the coefficients are significant. The problem is that when I run the R code I get t-values instead of z-values. I found code on how to calculate p-values for z-values and I'm wondering if you can use the same code for the t-values that you use for the z-values to calculate the p-values.

This is the code for when you have z-values:

ctable <- coef(summary(m))
pvals <- 2 * pt(abs(ctable[, "z value"]), df.residual(m), lower.tail = FALSE)
cbind(ctable, pvals)


This is the code I used for the t-values:

ctable <- coef(summary(m))
pvals <- 2 * pt(abs(ctable[, "t value"]), df.residual(m), lower.tail = FALSE)
cbind(ctable, pvals)

Value  Std. Error   t value         pvals
(Intercept):1   209.559678 32.50165463  6.447662  3.327237e-10
(Intercept):2    4.184758  0.05227107 80.058783 7.628269e-246