Digital metasurfaces as space-coded surfaces composed of a set of sub-wavelength meta-atoms enable extraordinary capabilities to manipulate electromagnetic waves. Recently, amplitude-phase-joint-coding metasurfaces have been proposed to achieve enhanced beam shaping. However, design of a unit cell structure with a full manipulation of amplitude and phase of the reflected beam is challenging and this kind of unit cell structures are complicated. This paper proposes a space-time phase-only metasurface based on simple graphene-based unit cell that is digitally coded and arranged with a specific time sequence, allowing the effective simultaneous manipulation of both phase and amplitude. In this way, it is demonstrated that the terahertz beam can be shaped using the proposed terahertz metasurface.