We derive explicit formulas for the generating functions of B-splines with knots in either geometric or affine progression. To find generating functions for B-splines whose knots have geometric or affine ratio q, we construct a PDE for these generating functions in which classical derivatives are replaced by q-derivatives. We then solve this PDE for the generating functions using q-exponential functions. We apply our generating functions to derive some known and some novel identities for B-splines with knots in geometric or affine progression, including a generalization of the Schoenberg identity, formulas for sums and alternating sums, and an explicit expression for the moments of these B-splines. Special cases include both the uniform B-splines with knots at the integers and the nonuniform B-splines with knots at the q-integers.