Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

time_put


inherits fromtime_put_base time_put inherits fromlocale::facet

Summary

A time formatting facet for output.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <locale>
template <class charT, class OutputIterator = 
          ostreambuf_iterator<charT> >
class time_put;

Description

The time_put facet includes facilities for formatted output of date/time values. The member function of time_put takes a date/time in the form of a struct tm and translates this into a character string representation.

Interface

Types

char_type
iter_type

Constructors

explicit time_put(size_t refs = 0); 

Destructors

~time_put();  // virtual and protected

Facet ID

static locale::id id;

Public Member Functions

iter_type 
put(iter_type s, ios_base& f, 
    char_type fill, const tm* tmb,
    const charT* pattern, const charT* pat_end) const; 

Protected Member Functions

iter_type 
do_put(iter_type s, ios_base& f, char_type fill,
    const tm* tmb, char format, char modifier = 0) const; 

Table 1 -- Formatting characters used by strftime() . For those formats that do not use all members of the struct tm, only those members that are actually used are noted [in brackets].

Format character Meaning Example
a
Abbreviated weekday name [from tm::tm_wday]
Sun
A
Full weekday name [from tm::tm_wday]
Sunday
b
Abbreviated month name
Feb
B
Full month name
February
c
Date and time [may use all members]
Feb 29 14:34:56 1984
d
Day of the month
29
H
Hour of the 24-hour day
14
I
Hour of the 12-hour day
02
j
Day of the year, from 001 [from tm::tm_yday]
60
m
Month of the year, from 01
02
M
Minutes after the hour
34
p
AM/PM indicator, if any
AM
S
Seconds after the minute
56
U
Sunday week of the year, from 00 [from tm::tm_yday and tm::tm_wday]

w
Day of the week, with 0 for Sunday
0
W
Monday week of the year, from 00 [from tm::tm_yday and tm::tm_wday]

x
Date [uses tm::tm_yday in some locales]
Feb 29 1984
X
Time
14:34:56
y
Year of the century, from 00 (deprecated)
84
Y
Year
1984
Z
Time zone name [from tm::tm_isdst]
PST or PDT

Example

See Also

locale, facets, time_get



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998