This changes the internal representation of time to UTC.

Using UTC rather than localtime makes it possible to record programs during daylight savings time changes without overly complicating the code.

Unfortunately, the QDateTime initializers all either set the DateSpec to localtime or they set it do undefined. This means you can not use QDateTime::setTime_t(), QDateTime::currentDateTime(), QDateTime::fromString(), QDateTime::fromTime_t(), QDateTime::setDate(), QDateTime::setTime(), or QDateTime::setMSecsSinceEpoch() directly unless you follow it with a QDateTime::toUTC() or QDateTime::setDateSpec((Qt::UTC) depending on which method you use. You can use the QDateTime(QDate,QTime,Qt::TimeSpec) constructor, but only if you specify the Qt::TimeSpec.

To make time manipulation in UTC easier given these constraints several utility function have been to the MythDate namespace (currently these live in libmythbase/util.{h,cpp}.

QDateTime as_utc(const QDateTime&) -- Returns a copy of the QDateTime with the TimeSpec set to Qt::UTC, this can be used when pulling DATETIME values from the database. For Example, QDateTime tm = as_utc(query.value(0).toDateTime());

QDateTime current(bool stripped=false) -- Returns the current date and time in UTC. If stripped is set to true the millisecond portion of the time is stripped.

QString current_iso_string(bool stripped=false) -- Returns current(stripped).toString(Qt::ISODate). Purely for convenience.

QDateTime fromTime_t(uint s) -- Returns a QDateTime in UTC initialized from a time_t.

QDateTime fromString(const QString&) -- Returns a QDateTime in UTC initialized from a string in either Qt::ISODate format or "yyyyMMddhhmmss" format.

QDateTime fromString(const QString &date, const QString &format) -- Returns a QDateTime in UTC initialized using an arbitrary format, such as RFC822.

QString toString(const QDateTime &, uint format) -- Returns a formatted string in one of the MythTV recognized formats. The format should be one or more of the flags in MythDate::Format. These come in two flavors, formats intended for use in the database or filesystem such as kISODate, kFilename, kDatabase default to UTC, while formats intended for display default to local time. You can override these defaults with the kOverrideUTC and kOverrideLocal flags.

Traditionally MythTV has not set the timespec to Qt::UTC when dealing with UTC time, this presents problems when comparing times in local time to times in UTC. With the internal represetation of time in UTC it is important to either use these functions for initializing a QDateTime or to properly set the timespec otherwise time comparisons with times from Qt such as that returned from QFileInto::lastModified() will not work correction. As a corrilary, time represented in UTC with the timespec set correctly will compare correctly with a QDateTime in localtime with the timespec set correctly. So if you use these functions when initializing times represented in UTC you won't have any headaches dealing with the times returned from Qt functions.

Since Qt returns times in localtime from it's various functions you will need to convert these to UTC when saving them in a variable for later use. This is accomplished with the toUTC() function. For example, QDateTime mod_time = QFileInfo("x.mpg").toUTC(); This is mainly so that people reading your code can safely assume all times are in UTC which saves them from having to figure out from the code whether you are using localtime or UTC. Another reason for doing this is in case the the variable is saved to the database, we want all times in the database to be in UTC for consistency.
It helps to return the date you've constructed from in a date function..
Convert to local time before calling dayOfWeek() for week day check.
Date/Time cleanup of ManualSchedule.
Make the FileScanner's location enum private and fix some locations where sed had replaced the local kDatabase with MythDate::kDatabase.
Fix some trivial issues in plugins.
Remove QDateTime->QString conversion for a DATETIME binding.
Fix some instances where ISODate was being used for DB insterts.

mysql 5.5 and later reject ISO 8601 combined date and time format when used for DATETIME inserts.
Trivial fixes for plugins.
Merge branch 'master' into utc

Conflicts:
	mythtv/libs/libmyth/programinfo.cpp
	mythtv/libs/libmythbase/logging.cpp
	mythtv/libs/libmythbase/mythcommandlineparser.cpp
	mythtv/libs/libmythbase/mythdownloadmanager.cpp
	mythtv/libs/libmythbase/util.h
	mythtv/libs/libmythprotoserver/requesthandler/deletethread.cpp
	mythtv/libs/libmythtv/datadirect.cpp
	mythtv/libs/libmythtv/eithelper.cpp
	mythtv/libs/libmythtv/livetvchain.cpp
	mythtv/libs/libmythtv/mpeg/atsctables.h
	mythtv/libs/libmythtv/mythsystemevent.cpp
	mythtv/libs/libmythtv/recordingrule.cpp
	mythtv/libs/libmythtv/tv_play.cpp
	mythtv/programs/mythbackend/mainserver.cpp
	mythtv/programs/mythbackend/services/dvr.cpp
	mythtv/programs/mythbackend/services/video.cpp
	mythtv/programs/mythfilldatabase/main.cpp
	mythtv/programs/mythfrontend/guidegrid.cpp
	mythtv/programs/mythfrontend/proglist.cpp
Merge branch 'master' into utc

Conflicts:
	mythplugins/mythmusic/mythmusic/metadata.cpp
	mythplugins/mythmusic/mythmusic/smartplaylist.cpp
	mythtv/libs/libmyth/programinfo.cpp
	mythtv/libs/libmythbase/mythdownloadmanager.cpp
	mythtv/libs/libmythbase/util.h
	mythtv/libs/libmythmetadata/videometadata.cpp
	mythtv/libs/libmythmetadata/videoscan.cpp
	mythtv/libs/libmythtv/datadirect.cpp
	mythtv/libs/libmythtv/mythsystemevent.cpp
	mythtv/libs/libmythtv/tv_rec.cpp
	mythtv/libs/libmythui/mythuihelper.cpp
	mythtv/programs/mythbackend/scheduler.cpp
	mythtv/programs/mythfrontend/playbackbox.cpp
	mythtv/programs/mythfrontend/proglist.cpp
	mythtv/programs/mythfrontend/proglist_helpers.cpp
	mythtv/programs/mythfrontend/schedulecommon.cpp
	mythtv/programs/mythfrontend/statusbox.cpp
	mythtv/programs/mythtranscode/transcode.cpp
Merge branch 'master' into utc

Conflicts:
	mythtv/libs/libmythbase/mythcommandlineparser.cpp
	mythtv/libs/libmythtv/recordingrule.cpp
	mythtv/libs/libmythui/mythdialogbox.cpp
Merge commit 'ba9b5d3c' into utc

Conflicts:
	mythplugins/mythzoneminder/mythzoneminder/zmclient.cpp
	mythtv/libs/libmythbase/util.cpp
Merge commit 'a130e748' into utc

Conflicts:
	mythtv/programs/mythfrontend/progdetails.cpp
Merge branch 'master' into utc

Conflicts:
	mythtv/libs/libmythbase/mythcommandlineparser.cpp
Merge branch 'master' into utc

Conflicts:
	mythtv/libs/libmythtv/dbcheck.cpp
	mythtv/libs/libmythtv/dtvrecorder.cpp
Merge branch 'master' into utc

Conflicts:
	mythtv/programs/mythtranscode/mpeg2fix.cpp
Remove toLocalTime in a couple RSSParse functions.
Convert times to UTC in fromXMLTVDate.
Add missing QDateTime timespec.