- What language are you talking about (C, C++, C#, Java, Python, etc)?
- Are you sure you have included the right headers/imports/etc?
- Are you sure you've selected the right language for your code (top right corner)?
If you copy-paste the code sample from the localtime() documentation, it works just fine.