When dealing with differentiable surfaces one defines a function $f:S\rightarrow \mathbb{R}$ as being differentiable if its expression in local coordinates is differentiable. But one could also define it to be differentiable if there exists differentiable function $F: V\subset \mathbb{R}^3 \rightarrow \mathbb{R}$ from an open set $V$ of $\mathbb{R}^3$ such that $S\subset V$ and $F|_{S} = f$, i.e. a differentiable extension of $f$.
Are these two definitions of differentiability equivalent? More precisely, when given a differentiable function on a surface can you always extend it to a differentiable function of an open set of $\mathbb{R}^3$ containing the surface?