NaviServer - programmable web server

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

# ns_fmttime(n) 4.99.8 naviserver "NaviServer Built-in Commands"

## Name

ns_fmttime - Convert seconds to a human-readable format using templates

## Table Of Contents

## Synopsis

- ns_fmttime time ?fmt?

## Description

This command produces a string representation of time in seconds since 00:00:00 UTC Jan 1, 1970.

ns_fmttime uses the strftime() system call, so valid fmt strings will vary from platform to platform. Consult your operating system's documentation for strftime() to see what valid fmt strings can contain. fmt defaults to "%c" which is supposed to be the preferred date and time representation for the current locale, which on some platforms should be "%a %b %e %H:%M:%S %Z %Y".

## COMMANDS

ns_fmttime time ?fmt?

## EXAMPLES

       % ns_fmttime 0
       Wed Dec 31 19:00:00 1969

       % ns_fmttime 0 "%a %b %e %H:%M:%S %Z %Y"
       Wed Dec 31 19:00:00 EST 1969

       % ns_fmttime ns_time "%Y%m%d"
       20040614

## See Also

ns_gmtime, ns_httptime, ns_localtime, ns_parsehttptime, ns_parsetime, ns_time

## Keywords

time