(1) Define your own datatime class.
(2) Define the operator <<()
and operator >>()
for it. In these function, use std::time_put
and std::time_get
facet to implement.
(3) If the std::time_put
and std::time_get
can't satisfy your needs, you can define your own time_put/get facet by inheriting them, and other assistant facet such as date_time format manager if necessary.
PS: If you're using c++11, std::time_put::put()
and std::time_get::get()
may be satisfied.
Good Luck!