When you have a String you should use String-Functions to handle it. In your case SubString could solve the Problem ...
OutString = inDate.SubString(0,8)
The Format-Function will only work (like posted by you) if your Source-Variable has the Type of Date ...