Nonlinear dynamical systems in reality are often under environmental influences that are time-dependent. To assess whether such a system can perform as desired or as designed and is sustainable requires forecasting its future states and attractors based solely on time series. We propose a viable solution to this challenging problem by resorting to the compressive-sensing paradigm. In particular, we demonstrate that, for a dynamical system whose equations are unknown, a series expansion in both dynamical and time variables allows the forecasting problem to be formulated and solved in the framework of compressive sensing using only a few measurements. We expect our method to be useful in addressing issues of significant current concern such as the sustainability of various natural and man-made systems. (C) 2012 American Institute of Physics.