Mantid
Loading...
Searching...
No Matches
Functions | Variables
Mantid::Kernel::DateAndTimeHelpers Namespace Reference

Functions

MANTID_KERNEL_DLL Types::Core::DateAndTime averageSorted (const std::vector< Types::Core::DateAndTime > &times)
 averageSorted Assuming that the vector is sorted, find the average time More...
 
MANTID_KERNEL_DLL Types::Core::DateAndTime averageSorted (const std::vector< Types::Core::DateAndTime > &times, const std::vector< double > &weights)
 
MANTID_KERNEL_DLL Types::Core::DateAndTime createFromSanitizedISO8601 (const std::string &date)
 Creates a DateAndTime object from a date string even if the string does not exactly conform to ISO8601 (ARGUS File) More...
 
MANTID_KERNEL_DLL std::string verifyAndSanitizeISO8601 (const std::string &date, bool displayWarnings)
 Verifies whether or not a string conforms to ISO8601. More...
 

Variables

Logger g_log ("DateAndTime")
 

Function Documentation

◆ averageSorted() [1/2]

Types::Core::DateAndTime Mantid::Kernel::DateAndTimeHelpers::averageSorted ( const std::vector< Types::Core::DateAndTime > &  times)

averageSorted Assuming that the vector is sorted, find the average time

Definition at line 85 of file DateAndTimeHelpers.cpp.

Referenced by Mantid::DataObjects::EventList::compressFatEventsHelper().

◆ averageSorted() [2/2]

Types::Core::DateAndTime Mantid::Kernel::DateAndTimeHelpers::averageSorted ( const std::vector< Types::Core::DateAndTime > &  times,
const std::vector< double > &  weights 
)

Definition at line 102 of file DateAndTimeHelpers.cpp.

◆ createFromSanitizedISO8601()

Types::Core::DateAndTime Mantid::Kernel::DateAndTimeHelpers::createFromSanitizedISO8601 ( const std::string &  date)

Creates a DateAndTime object from a date string even if the string does not exactly conform to ISO8601 (ARGUS File)

Parameters
dateDate used to create DateAndTime object. May be sanitized first.

Definition at line 39 of file DateAndTimeHelpers.cpp.

References verifyAndSanitizeISO8601().

Referenced by Mantid::DataHandling::CompressEvents::exec(), Mantid::DataHandling::LoadEventNexus::loadEvents(), Mantid::DataHandling::LoadMuonNexus2::loadRunDetails(), and Mantid::DataHandling::LoadNexusMonitors2::readEventMonitorEntry().

◆ verifyAndSanitizeISO8601()

std::string Mantid::Kernel::DateAndTimeHelpers::verifyAndSanitizeISO8601 ( const std::string &  date,
bool  displayWarnings 
)

Verifies whether or not a string conforms to ISO8601.

Corrects the string if it does not and is of the ARGUS file date/time format. e.g 2009-07- 8T10:23:50 becomes 2009-07-08T10:23:50.

Parameters
dateDate to be checked/corrected
displayWarningsdisplay warning messages in the log if the date is non conforming.

Definition at line 51 of file DateAndTimeHelpers.cpp.

References g_log, and Mantid::Kernel::Logger::warning().

Referenced by createFromSanitizedISO8601(), and MantidQt::API::AlgorithmDialog::setPreviousValue().

Variable Documentation

◆ g_log

Logger Mantid::Kernel::DateAndTimeHelpers::g_log("DateAndTime") ( "DateAndTime"  )

Referenced by Mantid::Kernel::ConfigServiceImpl::addDirectoryifExists(), Mantid::Kernel::FileValidator::checkValidity(), Mantid::Kernel::ConfigServiceImpl::ConfigServiceImpl(), Mantid::Kernel::LogParser::createLogProperty(), Mantid::Kernel::ConfigServiceImpl::createUserPropertiesFile(), Mantid::Kernel::InternetHelper::downloadFile(), Mantid::Kernel::TimeSeriesProperty< TYPE >::eliminateDuplicates(), Mantid::Kernel::ErrorReporter::ErrorReporter(), MantidQt::API::AlgorithmDialog::executeAlgorithmAsync(), Mantid::Kernel::FacilityInfo::fillArchiveNames(), Mantid::Kernel::FacilityInfo::fillExtensions(), Mantid::Kernel::FacilityInfo::fillInstruments(), Mantid::Kernel::InstrumentInfo::fillLiveData(), Mantid::Kernel::FacilityInfo::fillTimezone(), Mantid::Kernel::TimeSeriesProperty< TYPE >::filterByTimes(), Mantid::Kernel::TimeSeriesProperty< TYPE >::firstTime(), Mantid::Kernel::TimeSeriesProperty< TYPE >::firstValue(), Mantid::Kernel::ConfigServiceImpl::getFullPath(), Mantid::Kernel::ConfigServiceImpl::getInstrument(), Mantid::Kernel::ConfigServiceImpl::getOSVersionReadable(), Mantid::Kernel::Quat::getRotation(), Mantid::Kernel::TimeSeriesProperty< TYPE >::getSingleValue(), Mantid::Kernel::ConfigServiceImpl::getString(), Mantid::Kernel::Units::dSpacing::init(), Mantid::Kernel::FacilityInfo::instrument(), Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime(), Mantid::Kernel::TimeSeriesProperty< TYPE >::lastValue(), Mantid::Kernel::LibraryManagerImpl::LibraryManagerImpl(), Mantid::Kernel::LiveListenerInfo::LiveListenerInfo(), Mantid::Kernel::ConfigServiceImpl::loadConfig(), Mantid::Kernel::InternetHelper::logDebugRequestSending(), Mantid::Kernel::LogParser::LogParser(), Mantid::Kernel::ConfigServiceImpl::makeAbsolute(), Mantid::Kernel::TimeSeriesProperty< TYPE >::nthInterval(), Mantid::Kernel::TimeSeriesProperty< TYPE >::nthTime(), Mantid::Kernel::TimeSeriesProperty< TYPE >::nthValue(), Mantid::Kernel::DllOpen::openDll(), Mantid::Kernel::LibraryManagerImpl::openLibraries(), Mantid::Kernel::LibraryManagerImpl::openLibrary(), Mantid::Kernel::MemoryStats::process_mem_system(), Mantid::Kernel::GitHubApiHelper::processAnonymousRequest(), Mantid::Kernel::InternetHelper::processErrorStates(), Mantid::Kernel::InternetHelper::processRelocation(), Mantid::Kernel::GitHubApiHelper::processResponseHeaders(), Mantid::Kernel::ConfigServiceImpl::saveConfig(), Mantid::Kernel::ErrorReporter::sendErrorReport(), Mantid::Kernel::UsageServiceImpl::sendFeatureUsageReport(), Mantid::Kernel::ErrorReporter::sendReport(), Mantid::Kernel::UsageServiceImpl::sendReport(), Mantid::Kernel::InternetHelper::sendRequestAndProcess(), Mantid::Kernel::GitHubApiHelper::sendRequestAndProcess(), Mantid::Kernel::UsageServiceImpl::sendStartupReport(), Mantid::Kernel::ConfigServiceImpl::setFacility(), Mantid::Kernel::ConfigServiceImpl::setLogLevel(), Mantid::Kernel::UsageServiceImpl::shutdown(), Mantid::Kernel::TimeSeriesProperty< TYPE >::sortIfNecessary(), Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTime(), Mantid::Kernel::TimeSeriesProperty< TYPE >::splitByTimeVector(), Mantid::Kernel::TopicInfo::TopicInfo(), Mantid::Kernel::ConfigServiceImpl::updateFacilities(), Mantid::Kernel::UsageServiceImpl::UsageServiceImpl(), Mantid::Kernel::EqualBinsChecker::validate(), Mantid::Kernel::PropertyManager::validateProperties(), Mantid::Kernel::Interpolation::value(), and verifyAndSanitizeISO8601().