Ns cookietime

From AOLserver Wiki
Revision as of 19:44, 7 February 2009 by Gustafn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

NAME

ns_cookietime - Convert seconds to Netscape's cookie date format

SYNOPSIS

ns_cookietime time

DESCRIPTION

This command converts the time, specified as the number of seconds from 00:00:00 UTC Jan 1, 1970, to a string in Netscape's old cookie "Expires" date format (see RFC 2109 Sec 10.1.2).

CODE

NOTE: This command is not yet part of the standard core Tcl API for AOLserver.
 proc ns_cookietime {time} {
     regsub {, (\d+) (\S+) (\d+)} ns_httptime $time {, \1-\2-\3} string
     return $string
 }

EXAMPLES

   % ns_cookietime 0
   Thu, 01-Jan-1970 00:00:00 GMT
   % ns_cookietime 8675309
   Sat, 11-Apr-1970 09:48:29 GMT

SEE ALSO

ns_fmttime, ns_gmtime, ns_httptime, ns_localtime, ns_parsehttptime, ns_parsetime, ns_time

-