Where can I find the documentation on how to use variables in file names?

Hopefully this will be a simple one.

I want to save sensor logs\history to files with variables in the name.

For example “Device name, Current year, current, month, current day, current hour.whatever”

Where can I find the help file\documentation that covers the syntax for doing things like this, preferably a dummies version for new users.