[ Table Of Contents | Keyword Index ]

ns_fmttime(n) 4.99 "NaviServer Built-in Commands"

NAME

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

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    EXAMPLES
    SEE ALSO
    KEYWORDS

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

nsd

KEYWORDS

ns_gmtime , ns_httptime , ns_localtime , ns_parsehttptime , ns_parsetime , ns_time