Splice an optional date string and a time string into an OFDateTime. Returns true on success.
| 78 | // Splice an optional date string and a time string into an OFDateTime. |
| 79 | // Returns true on success. |
| 80 | bool ConvertDICOMDateTimeString(const std::string& dateString, |
| 81 | const std::string& timeString, |
| 82 | OFDateTime& time) |
| 83 | { |
| 84 | OFString content(timeString.c_str()); |
| 85 | |
| 86 | if (!dateString.empty()) |
| 87 | { |
| 88 | content = OFString(dateString.c_str()).append(content); |
| 89 | } |
| 90 | |
| 91 | const OFCondition result = DcmDateTime::getOFDateTimeFromString(content, time); |
| 92 | |
| 93 | return result.good(); |
| 94 | } |
| 95 | |
| 96 | // Returns (reference - injection) in seconds (the shared util reports ms). |
| 97 | double DurationInSeconds(const OFDateTime& injection, const OFDateTime& reference) |
no test coverage detected