---
name: "ns_time"
section: "3"
platform: "linux"
package: "aolserver4"
version: "4.0.10-7"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/ns_time"
---

# ns\_time(3)

commands

```

```

## NAME

ns\_time, ns\_fmttime, ns\_gmtime, ns\_localtime, - commands

## SYNOPSIS

**ns\_fmttime** *time* ?*format string*?

**ns\_gmtime**

**ns\_localtime**

**ns\_time**

```

```

## DESCRIPTION

**ns\_time**: Returns the value of time in seconds since 00:00:00 UTC, January 1, 1970. This return value is suitable as input to the ns\_httptime function to get the current time.

**ns\_fmttime**: Formats the time string,time,according to the format provided in format string. If no format is provided, defaults to "%a %b %e %H:%M:%S %Z %Y".

**ns\_gmttime**: Returns a Tcl list of the pieces of the current Greenwich Mean Time. The pieces are\
     seconds (0-59)\
     minutes (0-59)\
     hours (0-23)\
     dayofmonth (1-31)\
     monthofyear (0-11)\
     year (year-1900)\*\
     dayofweek (Sunday=0)\
     dayofyear (0-365)\
     1 if Daylight Savings Time is in effect

**ns\_localtime**: Returns a Tcl list of the pieces of the current local time. The pieces are\
     seconds (0-59)\
     minutes (0-59)\
     hours (0-23)\
     dayofmonth (1-31)\
     monthofyear (0-11)\
     year (year-1900)\*\
     dayofweek (Sunday=0)\
     dayofyear (0-365)\
     1 if Daylight Savings Time is in effect

## EXAMPLES

ns\_fmttime \[ns\_time\] returns: Tue Nov 12 15:14:47 2002 ns\_fmttime \[ns\_time\] "%Y%m%d" returns: 20021112

## SEE ALSO

ns\_httptime

## KEYWORDS
