C++ Utilities  4.9.1
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
format.h
Go to the documentation of this file.
1 #ifndef CHRONO_FORMAT_H
2 #define CHRONO_FORMAT_H
3 
4 #include "./datetime.h"
5 
6 #include <ostream>
7 
8 inline std::ostream &operator<<(std::ostream &out, const ChronoUtilities::DateTime &value)
9 {
11 }
12 
13 inline std::ostream &operator<<(std::ostream &out, const ChronoUtilities::TimeSpan &value)
14 {
15  return out << value.toString(ChronoUtilities::TimeSpanOutputFormat::Normal, false);
16 }
17 
18 #endif // CHRONO_FORMAT_H
std::string toString(DateTimeOutputFormat format=DateTimeOutputFormat::DateAndTime, bool noMilliseconds=false) const
Returns the string representation of the current instance using the specified format.
Definition: datetime.cpp:181
Represents an instant in time, typically expressed as a date and time of day.
Definition: datetime.h:51
std::ostream & operator<<(std::ostream &out, const ChronoUtilities::DateTime &value)
Definition: format.h:8
std::string toString(TimeSpanOutputFormat format=TimeSpanOutputFormat::Normal, bool noMilliseconds=false) const
Converts the value of the current TimeSpan object to its equivalent std::string representation accord...
Definition: timespan.cpp:66
Represents a time interval.
Definition: timespan.h:27