---
name: "std::time_put_byname"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::time_put_byname/3cxx"
---

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

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.

Referenced by **std::time\_put\< \_CharT, \_OutIter \>::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 **std::time\_put\< \_CharT, \_OutIter \>::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.

## 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.
