STD::TIME_PUT(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 7 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44

πŸ’– NAME πŸ’–

std::time_put< _CharT, _OutIter > β€” the Primary class template time_put. It's the vibe-setter for date and time formatting, bestie. πŸŽ€


✨ SYNOPSIS ✨

#include <locale>

Lowkey the family tree first: this one Inherits std::locale::facet, and it's Inherited by std::time_put_byname< _CharT, _OutIter >. So it's giving proud parent energy. πŸ’…

🌸 Public Types

  • char_type β€” typedef _CharT char_type. Public typedefs. (It's literally the character type, no notes. ✨)
  • iter_type β€” typedef _OutIter iter_type. Public typedefs. (The iterator type, periodt. πŸ¦‹)

🌈 Public Member Functions

  • time_put (size_t __refs=0) β€” Constructor performs initialization. The standard one, no cap.
  • 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. Same energy, different signature. πŸ”₯

⭐ Static Public Attributes

  • static locale::id id β€” Numpunct facet id.

🧚 Protected Member Functions

  • virtual ~time_put () β€” Destructor. Saying bye with grace. 😭
  • 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< _CharT, _OutIter >

"Primary class template time_put."

Okay so here's the tea β˜•: this facet encapsulates the code to format and output dates and times according to formats used by strftime().

The time_put template uses protected virtual functions to provide the actual results. The public accessors just forward the call to those virtual functions. And those virtual functions? They're hooks for developers to implement the behavior they require from the time_put facet. Iconic design, fr fr. πŸ‘‘


🌸 Member Typedef Documentation 🌸

template<typename _CharT, typename _OutIter> typedef _CharT std::time_put< _CharT, _OutIter >::char_type

Public typedefs.

template<typename _CharT, typename _OutIter> typedef _OutIter std::time_put< _CharT, _OutIter >::iter_type

Public typedefs.


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

template<typename _CharT, typename _OutIter> std::time_put< _CharT, _OutIter >::time_put (size_t __refs = 0) [inline], [explicit]

Constructor performs initialization. This is the constructor provided by the standard.

Parameters

  • __refs β€” Passed to the base facet class.

References std::locale::facet::facet().

template<typename _CharT, typename _OutIter> virtual std::time_put< _CharT, _OutIter >::~time_put () [inline], [protected], [virtual]

Destructor.


✨ 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]

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]

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

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]

Numpunct facet id.


πŸ‘‘ Author πŸ‘‘

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


okay bestie that's the whole thing, you ate it, no crumbs left πŸ’…βœ¨

And that's a wrap on std::time_put< _CharT, _OutIter >(3) from the Library Functions Manual, served fresh from libstdc++ β€” the manpage said std::time_... _OutIter >(3) at the bottom and honestly? iconic. go format some dates, you main character. πŸ«ΆπŸŒˆπŸ’–

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • centos-stream 10: libstdc++-docs 14.4.1-4.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 43: libstdc++-docs 15.2.1-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 43: libstdc++-docs 15.3.1-1.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms