Project 1
Functions
datetime.cc File Reference
#include "datetime.h"

Functions

ostream & operator<< (ostream &out, const DateTime &dt)
 
istream & operator>> (istream &in, DateTime &dt)
 

Function Documentation

◆ operator<<()

ostream& operator<< ( ostream &  out,
const DateTime dt 
)

Inserts a DateTime object in the format "MM/DD/YY HH:MM [AM|PM]" into the output stream, and returns the modified output stream.

Parameters
outthe output stream for insertion
dtthe DateTime object for insertion
Returns
the modified output stream

◆ operator>>()

istream& operator>> ( istream &  in,
DateTime dt 
)

Extracts a DateTime object in the format "MM/DD/YY HH:MM [AM|PM]" from the input stream, and returns the modified input stream. Sets the fail bit of the input stream if the object is improperly formatted. Indirectly throws an exception if a value in the stream is invalid.

Parameters
inthe input stream for extraction
dtthe DateTime object for storing the extracted information
Returns
the modified input stream
Exceptions
invalid_argumentif an argument's value is invalid