It looks like you are sending the date and time to the Transaction constructor as strings.
Inside of that constructor, you could just use regular string manipulation functions to pick out the details and rearrange them into the member variables that store the string.
For example:
Code:
#include <iostream>
#include <string>
int main()
{
std::string dateString = "20030901";
if (dateString.length() < 8)
{
std::cerr << "oops, bad date string." << std::endl;
return 1;
}
std::string yearString = dateString.substr(0, 4);
std::string monthString = dateString.substr(4, 2);
std::string dayString = dateString.substr(6, 2);
std::cout << dayString << "/" << monthString << "/" << yearString << std::endl;
return 0;
}