Time dataengine invalid sunrise and sunset results

Amos Kariuki amoskahiga at gmail.com
Thu Nov 26 05:56:09 CET 2009


I have some test code to obtain the sunrise and sunset time given a longitude and latitude for a location:

QString Latitude = "40";
QString Longitude = "-75";
Plasma::DataEngine* timeEngine = Plasma::DataEngineManager::self()->loadEngine("time");
const Plasma::DataEngine::Data timeData= timeEngine->query(QString("Local|Solar|Latitude=%1|Longitude=%2").arg(Latitude).arg(Longitude));
qDebug() << "Sunrise: " << timeData["Sunrise"] << "Sunset: " << timeData["Sunset"];

The result I get is:
Sunrise: QVariant(QDateTime, QDateTime("Tue Nov 24 20:01:02 2009") )
Sunset: QVariant(QDateTime, QDateTime("Wed Nov 25 05:32:35 2009") ) 


However, the results for that location (40, -75) based on NOAA's solar calculator at <http://www.esrl.noaa.gov/gmd/grad/solcalc/> are:
Sunrise: 05:57
Sunset: 15:37

Comparing to the test code results, it seems like the sunrise and sunset time are switched (sunrise time is in the evening @ 20:01) and have a significant offset (>20 min).  Is 
this a bug or am I misunderstanding the results?

Amos Kariuki



More information about the Plasma-devel mailing list