MythTV  master
Enumerations | Functions
MythDate Namespace Reference

Enumerations

enum  Format {
  ISODate = Qt::ISODate, kFilename = 0x000100, kDateFull = 0x000200, kDateShort = 0x000400,
  kDateEither = kDateFull | kDateShort, kTime = 0x000800, kDateTimeFull = kDateFull | kTime, kDateTimeShort = kDateShort | kTime,
  kAddYear = 0x001000, kSimplify = 0x002000, kDatabase = 0x004000, kAutoYear = 0x008000,
  kScreenShotFilename = 0x010000, kRFC822 = 0x020000, kOverrideUTC = 0x100000, kOverrideLocal = 0x200000
}
 

Functions

QDateTime current (bool stripped=false)
 Returns current Date and Time in UTC. More...
 
QString current_iso_string (bool stripped=false)
 Returns current Date and Time in UTC as a string. More...
 
QDateTime as_utc (const QDateTime &dt)
 Returns copy of QDateTime with TimeSpec set to UTC. More...
 
QDateTime fromString (const QString &dtstr)
 Converts kFilename && kISODate formats to QDateTime. More...
 
MBASE_PUBLIC QDateTime fromString (const QString &dt, const QString &format)
 Converts dy in format to QDateTime. More...
 
MBASE_PUBLIC QDateTime fromSecsSinceEpoch (int64_t seconds)
 This function takes the number of seconds since the start of the epoch and returns a QDateTime with the equivalent value. More...
 
QString toString (const QDateTime &datetime, uint format=MythDate::kDateTimeFull)
 Returns formatted string representing the time. More...
 
QString toString (const QDate date, uint format)
 Returns a formatted QString based on the supplied QDate. More...
 
std::chrono::seconds toSeconds (QTime time)
 Returns the total number of seconds since midnight of the supplied QTime. More...
 
std::chrono::milliseconds currentMSecsSinceEpochAsDuration (void)
 
std::chrono::seconds secsInPast (const QDateTime &past)
 
std::chrono::seconds secsInFuture (const QDateTime &future)
 
QString formatTime (std::chrono::milliseconds msecs, QString fmt)
 Format a milliseconds time value. More...
 

Enumeration Type Documentation

◆ Format

Enumerator
ISODate 

Default UTC.

kFilename 

Default UTC, "yyyyMMddhhmmss".

kDateFull 

Default local time.

kDateShort 

Default local time.

kDateEither 

Default local time.

kTime 

Default local time.

kDateTimeFull 

Default local time.

kDateTimeShort 

Default local time.

kAddYear 

Add year to string if not included.

kSimplify 

Do Today/Yesterday/Tomorrow transform.

kDatabase 

Default UTC, database format.

kAutoYear 

Add year only if different from current year.

kScreenShotFilename 

"yyyy-MM-ddThh-mm-ss.zzz"

kRFC822 

HTTP Date format.

kOverrideUTC 

Present date/time in UTC.

kOverrideLocal 

Present date/time in localtime.

Definition at line 15 of file mythdate.h.

Function Documentation

◆ current()

MBASE_PUBLIC QDateTime MythDate::current ( bool  stripped = false)

Returns current Date and Time in UTC.

Parameters
strippedif true milliseconds are stripped

Definition at line 14 of file mythdate.cpp.

Referenced by MythNVDECInterop::Acquire(), MythTVMenuItemContext::AddButton(), MythHTTPResponse::AddDefaultHeaders(), EITHelper::AddEIT(), V2Video::AddVideo(), Video::AddVideo(), RecordingInfo::ApplyNeverRecord(), TV::AskAllowRecording(), Scheduler::AssignGroupInput(), AudioDeviceComboBox::AudioDeviceComboBox(), MythNavigationOverlay::AudioStateChanged(), DBUtil::BackupDB(), MythOpenGLVideo::BindTextures(), DTVRecorder::BufferedWrite(), HTTPRequest::BuildResponseHeader(), MythUIProgressBar::CalculatePosition(), ProgramInfo::CalculateRecordedProgress(), MythVideoColourSpace::ChangePictureAttribute(), Scheduler::ChangeRecordingEnd(), OSD::CheckExpiry(), HouseKeeperTask::CheckImmediate(), MythThemedMenu::checkPinCode(), HouseKeeperTask::CheckStartup(), ImageSearchResultsDialog::cleanCacheDir(), NetBase::CleanCacheDir(), MetadataResultsDialog::cleanCacheDir(), cleanThumbnailCacheDir(), CleanupTask::CleanupInUsePrograms(), JobQueue::CleanupOldJobsInQueue(), CleanupTask::CleanupOrphanedLiveTV(), ProgramInfo::clear(), PreviewGeneratorQueue::ClearPreviewGeneratorAttempts(), ProgramInfo::clone(), comp_priority(), comp_retry(), connect_to_master(), ProgramRecPriority::countMatches(), DBUtil::CreateBackupFilename(), MythSessionManager::CreateUserSession(), current_iso_string(), ScheduleCommon::customEvent(), ViewScheduled::customEvent(), MythThemedMenu::customEvent(), NewsSite::customEvent(), MainServer::customEvent(), MainServer::DeletePBS(), OSD::DialogShow(), ThreadedFileWriter::DiskLoop(), MythPlayerUI::DisplayNormalFrame(), doBurnDVD(), ParentalLevelChangeCheckerPrivate::DoCheck(), TV::DoEditSchedule(), MythPlayerEditorUI::DoFastForwardSecs(), StatusBox::doJobQueueStatus(), MythDVDPlayer::DoJumpChapter(), MythPlayer::DoJumpChapter(), StatusBox::doListingsStatus(), doNativeArchive(), StatusBox::doRenderStatus(), CommBreakMap::DoSkipCommercials(), LCDProcClient::dostdclock(), MythDownloadManager::downloadFinished(), MythDownloadManager::downloadNow(), MythDownloadManager::downloadProgress(), MythDownloadManager::downloadQNetworkRequest(), OSD::Draw(), MusicMetadata::dumpToDatabase(), ScheduleCommon::EditRecording(), EITCache::EITCache(), TVRec::EnableActiveScan(), evaluateDateValue(), PreviewGeneratorQueue::event(), MythPlayer::FastForward(), ViewScheduleDiff::fillList(), GameUI::fillNode(), GuideUpdateProgramRow::fillProgramRowInfosWith(), Scheduler::FillRecordList(), VBoxDeviceIDList::fillSelections(), DVBCardNum::fillSelections(), ASIDevice::fillSelections(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), FillUpcomingList(), PrePostRollFlagger::findBreakInrange(), RecExtEspnDataSource::findInfoUrl(), RecExtMlbDataSource::findInfoUrl(), XmlConfiguration::FindNode(), TVRec::FinishedRecording(), EncoderLink::FinishRecording(), FlagCommercials(), MythNavigationOverlay::GeneralAction(), PreviewGeneratorQueue::GeneratePreviewImage(), Scheduler::GetAllScheduled(), V2Status::GetBackendStatus(), DVBStreamData::GetCachedBAT(), DVBStreamData::GetCachedBATs(), ATSCStreamData::GetCachedCVCT(), ATSCStreamData::GetCachedCVCTs(), ATSCStreamData::GetCachedMGT(), DVBStreamData::GetCachedNIT(), DVBStreamData::GetCachedSDT(), DVBStreamData::GetCachedSDTs(), DVBStreamData::GetCachedSDTSections(), ATSCStreamData::GetCachedTVCT(), ATSCStreamData::GetCachedTVCTs(), Channel::GetChannelInfoList(), V2Channel::GetChannelInfoList(), Dvr::GetConflictList(), V2Dvr::GetConflictList(), UPnpCDSExtension::GetCurrentToken(), getDailyWakeupTime(), MythDisplay::GetDescription(), Dvr::GetExpiringList(), V2Dvr::GetExpiringList(), MPEG2fixup::GetFrame(), JobQueue::GetJobsInQueue(), MythDownloadManager::GetLastModified(), MetaGrabberScript::GetList(), MythCommandLineParser::GetLogFilePath(), Scheduler::GetNextLiveTVDir(), TVBrowseHelper::GetNextProgramDB(), RecExtDataPage::getNow(), Dvr::GetOldRecordedList(), V2Dvr::GetOldRecordedList(), Guide::GetProgramGuide(), V2Guide::GetProgramGuide(), Guide::GetProgramList(), V2Guide::GetProgramList(), TVRec::GetProgramRingBufferForLiveTV(), Dvr::GetRecordedList(), V2Dvr::GetRecordedList(), EncoderLink::GetRecordingStatus(), Dvr::GetRecordScheduleList(), V2Dvr::GetRecordScheduleList(), MythVAAPIInteropDRM::GetReferenceFrames(), MythVTBSurfaceInterop::GetReferenceFrames(), getStatus(), V2Video::GetStreamInfo(), Video::GetStreamInfo(), Image::GetSyncStatus(), Myth::GetTimeZone(), V2Myth::GetTimeZone(), Music::GetTrackList(), V2Music::GetTrackList(), Dvr::GetUpcomingList(), V2Dvr::GetUpcomingList(), V2Video::GetVideoList(), Video::GetVideoList(), Channel::GetVideoMultiplexList(), V2Channel::GetVideoMultiplexList(), Channel::GetVideoSourceList(), V2Channel::GetVideoSourceList(), PrePostRollFlagger::go(), CommDetector2::go(), ClassicCommDetector::go(), EncoderLink::GoToSleep(), GuideGrid::GuideGrid(), Scheduler::HandleIdleShutdown(), TVRec::HandlePendingRecordings(), MainServer::HandleQueryRecordings(), Scheduler::HandleRecording(), Scheduler::HandleRunSchedulerStartup(), TV::HandleStateChange(), TVRec::HandleStateChange(), DTVRecorder::HandleTimestamps(), Scheduler::HandleWakeSlave(), DVBStreamData::HasCachedAllBAT(), DVBStreamData::HasCachedAllBATs(), ATSCStreamData::HasCachedAllCVCTs(), DVBStreamData::HasCachedAllNIT(), DVBStreamData::HasCachedAllSDT(), DVBStreamData::HasCachedAllSDTs(), ATSCStreamData::HasCachedAllTVCTs(), ATSCStreamData::HasCachedAllVCTs(), DVBStreamData::HasCachedAnyBAT(), ATSCStreamData::HasCachedAnyCVCTs(), DVBStreamData::HasCachedAnyNIT(), DVBStreamData::HasCachedAnySDT(), ATSCStreamData::HasCachedAnyTVCTs(), ATSCStreamData::HasCachedAnyVCTs(), ATSCStreamData::HasCachedCVCT(), ATSCStreamData::HasCachedMGT(), DVBStreamData::HasCachedSDT(), ATSCStreamData::HasCachedTVCT(), JobQueue::HasRunningOrPendingJobs(), MythUIAnimation::IncrementCurrentTime(), AudioSetupWizard::Init(), ThemeChooser::Init(), LiveTVChain::InitializeNewChain(), JobQueue::InJobRunWindow(), PreviewGeneratorQueue::IsGeneratingPreview(), MythUserSession::IsValid(), LiveTVChain::JumpToNext(), MythNavigationOverlay::keyPressEvent(), MythNotificationScreen::keyPressEvent(), MSqlDatabase::KickDatabase(), GameHandler::Launchgame(), NetworkControl::listSchedule(), LoadFromRecorded(), ViewScheduled::LoadList(), ProgramInfo::LoadProgramFromRecorded(), ThemeChooser::LoadVersion(), PreviewGenerator::LocalPreviewRun(), lock_channel(), V2Video::LookupVideo(), Video::LookupVideo(), ProgramInfo::MarkAsInUse(), markUpdated(), MythVDPAUHelper::MixerRender(), MPEG2fixup::MPEG2fixup(), MSqlDatabase::MSqlDatabase(), MythArchiveDateFormat(), MythDateFormatCB(), MythShortDateFormat(), needsUpdate(), HardwareProfile::NeedsUpdate(), MythScreenType::NextPrevWidgetFocus(), LCDProcClient::outputRecStatus(), RSSEditPopup::ParseAndSave(), Parse::ParseItem(), HTTPRequest::ParseRequest(), MythNavigationOverlay::PauseChanged(), MythOpenGLVideo::PrepareFrame(), HttpStatus::PrintEncoderStatus(), V2Status::PrintEncoderStatus(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), Scheduler::PrintList(), HttpStatus::PrintScheduled(), V2Status::PrintScheduled(), HttpStatus::PrintStatus(), V2Status::PrintStatus(), RecordingExtender::processActiveRecordings(), TV::ProcessNetworkControlCommand(), DeleteThread::ProcessNew(), DeleteThread::ProcessOld(), JobQueue::ProcessQueue(), MythRAOPConnection::ProcessRequest(), ProgramInfo::ProgramInfo(), MythUIThemeCache::PruneCacheDir(), MythUIClock::Pulse(), Animation::Pulse(), MDBManager::PurgeIdleConnections(), MDBManager::pushConnection(), Scheduler::PutInactiveSlavesToSleep(), ProgramInfo::QueryInUseMap(), ProgramInfo::QueryIsInUse(), HouseKeeperTask::QueryLast(), JobQueue::QueueJob(), JobQueue::QueueJobs(), RecordingRule::RecordingRule(), TVRec::RecordPending(), JobQueue::RecoverQueue(), MythPowerOSX::Refresh(), RemoteGetRecordingStatus(), NCPrivate::RemoveFirst(), ThemeChooser::removeTheme(), ScreenSaverX11Private::ResetScreenSaver(), MythPlayer::Rewind(), MpegRecorder::run(), V4L2encStreamHandler::run(), EITScanner::run(), GrabberScript::run(), FillData::Run(), TVBrowseHelper::run(), Scheduler::run(), AudioTestThread::run(), HouseKeeper::Run(), TVRec::run(), RunCCExtract(), AutoExpire::RunExpirer(), MythUserSession::Save(), ThemeChooser::saveAndReload(), SaveScan(), MythMainWindow::SaveScreenShot(), Scheduler::SchedLiveTV(), Scheduler::SchedNewRecords(), MusicFileScanner::SearchDirs(), secsInFuture(), secsInPast(), ProgFinder::selectShowData(), Streamer::SendBytes(), UPnpSearchTask::SendMsg(), MythAirplayServer::SendResponse(), OSD::SetExpiryPriv(), MythScreenType::SetFocusWidget(), PlayerContext::SetInitialTVState(), MythUIButtonList::SetItemCurrent(), MusicMetadata::setLastPlay(), HouseKeeperTask::SetLastRun(), RecorderBase::SetRecording(), MythNotificationScreen::SetSingleShotTimer(), EncoderLink::SetSleepStatus(), MythUIClock::SetText(), OSD::SetText(), VideoFilterSettings::setTextFilter(), AvFormatDecoder::SetupAudioStreamSubIndexes(), MythTVMenu::Show(), MythContextPrivate::ShowConnectionFailurePopup(), TV::ShowOSDAskAllow(), ThemeChooser::showPopupMenu(), shutdown(), WelcomeDialog::shutdownNow(), Scheduler::ShutdownServer(), AutoExpire::Sleep(), RSSEditPopup::SlotSave(), V4L2encSignalMonitor::StableResolution(), EITScanner::StartActiveScan(), EncoderLink::StartRecording(), EncoderLink::StopRecording(), TVRec::StopRecording(), HardwareProfile::SubmitProfile(), MythDisplay::SwitchToDesktop(), MythDisplay::SwitchToVideo(), RSSSite::timeSinceLastUpdate(), NewsSite::timeSinceLastUpdate(), RecStatus::toDescription(), RecordingRule::ToMap(), ProgramInfo::ToMap(), toString(), Transcode::TranscodeFile(), ThreadedFileWriter::TrimEmptyBuffers(), HDHRStreamHandler::TuneChannel(), HDHRStreamHandler::TuneVChannel(), TVRec::TuningFrequency(), TVRec::TuningShutdowns(), TVRec::TuningSignalCheck(), unlock_channel(), MythUserSession::Update(), VideoScannerThread::updateDB(), MythMediaBuffer::UpdateDecoderRate(), AutoExpire::UpdateDontExpireSet(), ProgramInfo::UpdateLastDelete(), HouseKeeperTask::UpdateLastRun(), updateLastRunEnd(), MusicFileScanner::updateLastRunEnd(), updateLastRunStart(), MusicFileScanner::updateLastRunStart(), Scheduler::UpdateManuals(), Scheduler::UpdateMatches(), updateNextScheduledRun(), TV::UpdateOSDSignal(), GalleryThumbView::UpdateScanProgress(), WelcomeDialog::updateStatusMessage(), MythMediaBuffer::UpdateStorageRate(), MainServer::UpdateSystemdStatus(), ZMConsole::updateTime(), Scheduler::WakeUpSlave(), ProgFinder::whereClauseGetSearchData(), JaProgFinder::whereClauseGetSearchData(), HeProgFinder::whereClauseGetSearchData(), RuProgFinder::whereClauseGetSearchData(), ThreadedFileWriter::Write(), XMLTVParser::XMLTVParser(), and ZMDateFormat().

◆ current_iso_string()

MBASE_PUBLIC QString MythDate::current_iso_string ( bool  stripped = false)

Returns current Date and Time in UTC as a string.

Parameters
strippedif true milliseconds are stripped

Definition at line 22 of file mythdate.cpp.

Referenced by MythCDROMLinux::checkMedia(), HTTPRequest::GetAuthenticationHeader(), BaseRequestHandler::HandleQueryTimeZone(), MainServer::HandleQueryTimeZone(), ParentalLevelChangeCheckerPrivate::OnPasswordEntered(), and NetworkControl::processQuery().

◆ as_utc()

MBASE_PUBLIC QDateTime MythDate::as_utc ( const QDateTime &  old_dt)

◆ fromString() [1/2]

MBASE_PUBLIC QDateTime MythDate::fromString ( const QString &  dtstr)

Converts kFilename && kISODate formats to QDateTime.

Definition at line 34 of file mythdate.cpp.

Referenced by Scheduler::AddNewRecords(), Dvr::AddRecordedProgram(), V2Dvr::AddRecordedProgram(), V2Video::AddVideo(), Video::AddVideo(), MediaMonitorUnix::CheckMountable(), MythThemedMenu::checkPinCode(), connect_to_master(), Service::ConvertToParameterPtr(), MythHTTPMetaMethod::CreateParameter(), MainServer::customEvent(), JobQueue::customEvent(), HouseKeeper::customEvent(), GallerySettings::DateFormat(), DateFromListItem(), HTTPRequest::DigestAuthentication(), ParentalLevelChangeCheckerPrivate::DoCheck(), MythFillDatabaseTask::DoCheckRun(), StatusBox::doListingsStatus(), MythDownloadManager::downloadQNetworkRequest(), LiveTVChain::entriesFromStringList(), PreviewGenerator::event(), ProgramInfo::ExtractKey(), ProgramInfo::ExtractKeyFromPathname(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), RecExtEspnDataPage::findGameInfo(), HTTPRequest::FormatFileResponse(), Parse::FromRFC3339(), fromXMLTVDate(), V2Status::GetBackendStatus(), getDailyWakeupTime(), ZMEvents::getDateList(), ZMClient::getEventList(), MainServer::getGuideDataThrough(), MythDownloadManager::GetLastModified(), NAMThread::GetLastModified(), TVBrowseHelper::GetNextProgram(), TVBrowseHelper::GetNextProgramDB(), PictureMetaData::GetOriginalDateTime(), VideoMetaData::GetOriginalDateTime(), getProgramInfoForFile(), MainServer::HandleDeleteRecording(), Scheduler::HandleIdleShutdown(), MainServer::HandleQueryRecording(), Scheduler::HandleReschedule(), MainServer::HandleUndeleteRecording(), MusicFileScanner::HasFileChanged(), JobQueue::InJobRunWindow(), DBUtil::IsBackupInProgress(), MythContextPrivate::LoadDatabaseSettings(), loadDetailsFromXML(), main(), RecExtMlbDataPage::parseGameObject(), Myth::ParseISODateString(), V2Myth::ParseISODateString(), Parse::ParseItem(), ParseMetadataItem(), ParseMetadataMovieNFO(), MythHTTPCache::PreConditionCheck(), HttpStatus::PrintEncoderStatus(), V2Status::PrintEncoderStatus(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), HttpStatus::PrintMachineInfo(), V2Status::PrintMachineInfo(), HttpStatus::PrintScheduled(), V2Status::PrintScheduled(), PlaybackBox::processNetworkControlCommand(), TV::QuickRecord(), MetaIOID3::read(), FillData::Run(), TVBrowseHelper::run(), VideoMetadataImp::saveToDatabase(), MusicFileScanner::SearchDirs(), CommandLineArg::Set(), setting_to_localtime(), setting_to_qdatetime(), shutdown(), Scheduler::ShutdownServer(), startup(), MythSystemEventHandler::SubstituteMatches(), VideoScannerThread::updateDB(), MusicMetadata::updateStreamList(), SmartPLDateDialog::valueChanged(), WasAutomaticStart(), and Scheduler::WasStartedAutomatically().

◆ fromString() [2/2]

MBASE_PUBLIC QDateTime MythDate::fromString ( const QString &  str,
const QString &  format 
)

Converts dy in format to QDateTime.

Definition at line 53 of file mythdate.cpp.

Referenced by fromString().

◆ fromSecsSinceEpoch()

MBASE_PUBLIC QDateTime MythDate::fromSecsSinceEpoch ( int64_t  seconds)

◆ toString() [1/2]

MBASE_PUBLIC QString MythDate::toString ( const QDateTime &  raw_dt,
uint  format 
)

Returns formatted string representing the time.

Returns a formatted QString based on the supplied QDateTime.

Parameters
raw_dtThe QDateTime object to use
formatThe format of the string to return

Definition at line 84 of file mythdate.cpp.

Referenced by SubtitleReader::AddAVSubtitle(), MythHTTPResponse::AddDefaultHeaders(), MythCBORSerialiser::AddValue(), MythJSONSerialiser::AddValue(), MythXMLSerialiser::AddValue(), AdjustFill(), LiveTVChain::AppendNewProgram(), AspectOverride(), DBUtil::BackupDB(), MSqlQuery::bindValue(), MSqlQuery::bindValueNoNull(), VideoListImp::buildGroupList(), HTTPRequest::BuildResponseHeader(), MythThemedMenu::checkPinCode(), DBUtil::CheckTableColumnExists(), ManualSchedule::Create(), MythTimeInputDialog::Create(), DBUtil::CreateBackupFilename(), ImageManagerFe::CreateImport(), CreateProgramInfoString(), PlaybackBox::CreateProgramInfoString(), ProgramInfo::CreateRecordBasename(), MythThemedMenu::customEvent(), ViewScheduled::deleteRule(), GuideGrid::deleteRule(), DetectLetterbox::Detect(), InfoList::Display(), SubtitleScreen::DisplayAVSubtitles(), StatusBox::doAutoExpireList(), doBurnDVD(), StatusBox::doJobQueueStatus(), StatusBox::doListingsStatus(), StatusBox::doLogEntries(), doNativeArchive(), LCDProcClient::dostdclock(), TV::DoTogglePictureAttribute(), Dvr::DupInToString(), V2Dvr::DupInToString(), Dvr::DupMethodToString(), V2Dvr::DupMethodToString(), ViewScheduled::FillList(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), GuideGrid::fillTimeInfos(), ProgLister::FillViewList(), RecordingExtender::findKnownSport(), FlagCommercials(), HTTPRequest::FormatFileResponse(), fromXMLTVDate(), IPTVTuningData::GetDeviceName(), ZMPlayer::getEventInfo(), Myth::GetFormatDate(), V2Myth::GetFormatDate(), Myth::GetFormatDateTime(), V2Myth::GetFormatDateTime(), Myth::GetFormatTime(), V2Myth::GetFormatTime(), JobQueue::GetJobInfoFromID(), JobQueue::GetJobsInQueue(), ProgramInfo::GetLastModifiedTime(), MythCommandLineParser::GetLogFilePath(), TVBrowseHelper::GetNextProgram(), MythMediaCodecContext::GetProfiles(), Dvr::GetRecordedMarkup(), V2Dvr::GetRecordedMarkup(), ProgramInfo::GetRecordingEndTime(), ProgramInfo::GetRecordingStartTime(), ProgramInfo::GetScheduledEndTime(), ProgramInfo::GetScheduledStartTime(), VideoMetadata::GetText(), AvFormatDecoder::GetTrackDesc(), ProgLister::HandleSelected(), DVBChannel::HasLock(), MythHTTPService::HTTPRequest(), MythVideoOutputNull::Init(), VideoOutputD3D::Init(), MythVAAPIContext::InitialiseContext(), VideoOutputD3D::InputChanged(), MythVideoOutputGPU::InputChanged(), LetterboxingColour(), PaneExistingScanImport::Load(), UPnpCDSTv::LoadDates(), ViewScheduled::LoadList(), ProgDetails::loadPage(), RecExtEspnDataSource::loadPage(), UPnpCDSMusic::LoadTracks(), UPnpCDSVideo::LoadVideos(), ImageManagerFe::LongDateOf(), TV::MenuItemDisplayPlayback(), MythPlayerVideoUI::PictureAttributeChanged(), TV::PictureAttributeHandleAction(), MythVAAPIContext::PostProcessFrame(), MythHTTPCache::PreConditionHeaders(), HttpStatus::PrintEncoderStatus(), V2Status::PrintEncoderStatus(), ClassicCommDetector::PrintFullMap(), HttpStatus::PrintJobQueue(), V2Status::PrintJobQueue(), HttpStatus::PrintMachineInfo(), V2Status::PrintMachineInfo(), HttpStatus::PrintScheduled(), V2Status::PrintScheduled(), HttpStatus::PrintStatus(), V2Status::PrintStatus(), RecordingExtender::processActiveRecordings(), MythHTTPFile::ProcessFile(), RecordingExtender::processNewRecordings(), JobQueue::ProcessQueue(), ProgramInfo::ProgramInfo(), QueueCommFlagJob(), RecordingQuality::RecordingQuality(), Dvr::RecTypeToString(), V2Dvr::RecTypeToString(), ProgramRecPriority::remove(), JSONSerializer::RenderValue(), XmlSerializer::RenderValue(), TVRec::run(), MythMainWindow::SaveScreenShot(), AvFormatDecoder::ScanStreams(), MSqlQuery::seekDebug(), MythAirplayServer::SendResponse(), TV::SetAutoCommercialSkip(), HTTPRequest::SetCookie(), MythVideoColourSpace::SetSupportedAttributes(), setting_to_localtime(), XmlConfiguration::SetValue(), ProgLister::SetViewFromTime(), setWakeupTime(), ProgLister::ShowDeleteRuleMenu(), shutdown(), Scheduler::ShutdownServer(), MythSystemEventHandler::SubstituteMatches(), LiveTVChain::SwitchTo(), ProgLister::SwitchToNextView(), ProgLister::SwitchToPreviousView(), MythVideoBounds::ToggleAdjustFill(), MythPlayerVideoUI::ToggleAdjustFill(), MythVideoBounds::ToggleAspectOverride(), RecordingRule::ToMap(), VideoMetadata::toMap(), ResultItem::toMap(), MetadataLookup::toMap(), MusicMetadata::toMap(), ProgramInfo::ToMap(), VirtualChannelMapSubtable::toStringXML(), ProgLister::UpdateButtonList(), GuideGrid::updateDateText(), ProgramRecPriority::updateInfo(), MythNews::updateInfoView(), HouseKeeperTask::UpdateLastRun(), ProgramRecPriority::UpdateList(), RecordingSelector::updateRecordingList(), WelcomeDialog::updateScreen(), ProgFinder::updateTimesList(), ZMEvents::updateUIList(), PlaybackBox::UpdateUILists(), UPnpCDS::UPnpCDS(), V2FillRecRuleInfo(), and DVBChannel::WaitForBackend().

◆ toString() [2/2]

MBASE_PUBLIC QString MythDate::toString ( const QDate  date,
uint  format 
)

Returns a formatted QString based on the supplied QDate.

Warning: this function can not convert to and from UTC.

Parameters
dateThe QDate object to use
formatThe format of the string to return

Definition at line 136 of file mythdate.cpp.

◆ toSeconds()

MBASE_PUBLIC std::chrono::seconds MythDate::toSeconds ( QTime  time)

Returns the total number of seconds since midnight of the supplied QTime.

Parameters
timeThe QTime object to use

Definition at line 186 of file mythdate.cpp.

◆ currentMSecsSinceEpochAsDuration()

MBASE_PUBLIC std::chrono::milliseconds MythDate::currentMSecsSinceEpochAsDuration ( void  )

◆ secsInPast()

MBASE_PUBLIC std::chrono::seconds MythDate::secsInPast ( const QDateTime &  past)

◆ secsInFuture()

MBASE_PUBLIC std::chrono::seconds MythDate::secsInFuture ( const QDateTime &  future)

◆ formatTime()

MBASE_PUBLIC QString MythDate::formatTime ( std::chrono::milliseconds  msecs,
QString  fmt 
)

Format a milliseconds time value.

Convert a millisecond time value into a textual representation of the value. QTime can't handle overflow of any of the fields, so the formatting needs to be done manually. Think a music playlist of more than 24 hours, or a single song of more than 60 minutes (e.g. a podcast or something like that).

Parameters
msecsThe time value in milliseconds. Since the type of this field is std::chrono::duration, any duration of a larger interval can be passed to this function and the compiler will convert it to milliseconds.
fmtA formatting string specifying how to output the time. Valid formatting characters are "Hmsz" for hours, minutes, seconds, and milliseconds, respectively. Consecutive runs of these characters will be replaced by at least as many characters as the run length, zero padding if necessary.

Definition at line 233 of file mythdate.cpp.

Referenced by CommBreakMap::AutoCommercialSkip(), DeleteMap::CreateTimeString(), CommBreakMap::DoSkipCommercials(), LyricsLine::formatTime(), ThumbFinder::frameToTime(), commDetector2::frameToTimestamp(), commDetector2::frameToTimestampms(), MusicCommon::getTimeString(), MythBDPlayer::GetTitleName(), TV::MenuItemDisplayPlayback(), AvFormatDecoder::OpenFile(), TV::ShowLCDDVDInfo(), commDetector2::strftimeval(), MusicMetadata::toMap(), LyricsLine::toString(), MythPlayerOverlayUI::UpdateSliderInfo(), MythBDBuffer::UpdateTitleInfo(), Ripper::updateTrackList(), and uptimeStr().