---
name: "std::time_put_byname"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::time_put_byname"
---

# std::time\_put\_byname(3)

class time\_put\_byname \[22.2.5.4\].

## NAME

std::time\_put\_byname\< \_CharT, \_OutIter \> - class time\_put\_byname \[22.2.5.4\].

## SYNOPSIS

\#include \<locale\>

Inherits **std::time\_put\< \_CharT, \_OutIter \>**.

### Public Types

typedef \_CharT **char\_type**\
 typedef \_OutIter **iter\_type**\

### Public Member Functions

**time\_put\_byname** (const char \*, size\_t \_\_refs=0)\
 **time\_put\_byname** (const **string** &\_\_s, size\_t \_\_refs=0)\
 iter\_type **put** (iter\_type \_\_s, **ios\_base** &\_\_io, char\_type \_\_fill, const tm \*\_\_tm, char \_\_format, char \_\_mod=0) const\
 Format and output a time or date.  iter\_type **put** (iter\_type \_\_s, **ios\_base** &\_\_io, char\_type \_\_fill, const tm \*\_\_tm, const \_CharT \*\_\_beg, const \_CharT \*\_\_end) const\
 Format and output a time or date.

### Static Public Attributes

static **locale::id** **id**\
 Numpunct facet id.

### Protected Member Functions

virtual iter\_type **do\_put** (iter\_type \_\_s, **ios\_base** &\_\_io, char\_type \_\_fill, const tm \*\_\_tm, char \_\_format, char \_\_mod) const\
 Format and output a time or date.

### Static Protected Member Functions

static \_\_c\_locale **\_S\_clone\_c\_locale** (\_\_c\_locale &\_\_cloc)  throw ()\
 static void **\_S\_create\_c\_locale** (\_\_c\_locale &\_\_cloc, const char \*\_\_s, \_\_c\_locale \_\_old=0)\
 static void **\_S\_destroy\_c\_locale** (\_\_c\_locale &\_\_cloc)\
 static \_\_c\_locale **\_S\_get\_c\_locale** ()\
 static const char \* **\_S\_get\_c\_name** ()  throw ()\
 static \_\_c\_locale **\_S\_lc\_ctype\_c\_locale** (\_\_c\_locale \_\_cloc, const char \*\_\_s)\

## Detailed Description

### template\<typename \_CharT, typename \_OutIter\>

class std::time\_put\_byname\< \_CharT, \_OutIter \>"class time\_put\_byname \[22.2.5.4\].

## Member Function Documentation

### template\<typename \_CharT, typename \_OutIter\> \_OutIter std::time\_put\< \_CharT, \_OutIter \>::do\_put (iter\_type \_\_s, ios\_base & \_\_io, char\_type \_\_fill, const tm \* \_\_tm, char \_\_format, char \_\_mod) const \[protected\], \[virtual\], \[inherited\]

Format and output a time or date. This function formats the data in struct tm according to the provided format char and optional modifier. This function is a hook for derived classes to change the value returned.

**See also**

put() for more details.

**Parameters**

*\_\_s* The stream to write to. \
 *\_\_io* Source of locale. \
 *\_\_fill* char\_type to use for padding. \
 *\_\_tm* Struct tm with date and time info to format. \
 *\_\_format* Format char. \
 *\_\_mod* Optional modifier char.

**Returns**

Iterator after writing.

References **std::ios\_base::\_M\_getloc()**, **std::use\_facet()**, and **std::\_\_ctype\_abstract\_base\< \_CharT \>::widen()**.

Referenced by **put()**, and **put()**.

### template\<typename \_CharT, typename \_OutIter\> iter\_type std::time\_put\< \_CharT, \_OutIter \>::put (iter\_type \_\_s, ios\_base & \_\_io, char\_type \_\_fill, const tm \* \_\_tm, char \_\_format, char \_\_mod = 0) const \[inline\], \[inherited\]

Format and output a time or date. This function formats the data in struct tm according to the provided format char and optional modifier. The format and modifier are interpreted as by strftime(). It does so by returning time\_put::do\_put().

**Parameters**

*\_\_s* The stream to write to. \
 *\_\_io* Source of locale. \
 *\_\_fill* char\_type to use for padding. \
 *\_\_tm* Struct tm with date and time info to format. \
 *\_\_format* Format char. \
 *\_\_mod* Optional modifier char.

**Returns**

Iterator after writing.

References **do\_put()**.

### template\<typename \_CharT, typename \_OutIter\> \_OutIter std::time\_put\< \_CharT, \_OutIter \>::put (iter\_type \_\_s, ios\_base & \_\_io, char\_type \_\_fill, const tm \* \_\_tm, const \_CharT \* \_\_beg, const \_CharT \* \_\_end) const \[inherited\]

Format and output a time or date. This function formats the data in struct tm according to the provided format string. The format string is interpreted as by strftime().

**Parameters**

*\_\_s* The stream to write to. \
 *\_\_io* Source of locale. \
 *\_\_fill* char\_type to use for padding. \
 *\_\_tm* Struct tm with date and time info to format. \
 *\_\_beg* Start of format string. \
 *\_\_end* End of format string.

**Returns**

Iterator after writing.

References **std::ios\_base::\_M\_getloc()**, **do\_put()**, **std::\_\_ctype\_abstract\_base\< \_CharT \>::narrow()**, and **std::use\_facet()**.

## Member Data Documentation

### template\<typename \_CharT, typename \_OutIter\> locale::id std::time\_put\< \_CharT, \_OutIter \>::id \[static\], \[inherited\]

Numpunct facet id.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
