in reply to Date and time for log files

You can use localtime or gmtime and time.

You can concatenate strings with a dot .