Name

strftime

Synopsis

strftime([format [,timestamp]]){G}

Format timestamp according to format. Return the formatted string. The timestamp is a time-of-day value in seconds since Midnight, January 1, 1970, UTC. The format string is similar to that of sprintf, in that it is a mixture of literal text and format specifiers. If timestamp is omitted, it defaults to the current time. If format is omitted, it defaults to a value that produces output similar to that of the Unix date command. See the date entry in Chapter 2 for a list.

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.