Skip to content
Snippets Groups Projects
Commit ce6c1c33 authored by Haug Michael's avatar Haug Michael
Browse files

changed output style/format of the timestamps

parent 9631eeb8
No related branches found
No related tags found
No related merge requests found
......@@ -24,13 +24,12 @@ public class Forecast {
/*
CopyToFile.CopyURLToFile("weatherCache\\" + SearchingAndComparing.GetID() + ".json");
CopyToFile.CopyURLToFile("weatherCache\\" + SearchingAndComparing.GetID() + ".json");
CopyToFile.CopyFileToWeather();
WeatherOutput.PrintWeather();
*/
}
}
......@@ -28,7 +28,6 @@ public class CopyToFile {
}
}
filePath = pathname;
//return pathname;
}
......
......@@ -49,4 +49,5 @@ public class FormatOutput {
return coordsLon + ", " + coordsLat;
}
}
......@@ -7,7 +7,7 @@ public class WeatherOutput {
Weather weatherObject = CopyToFile.CopyFileToWeather();
/**
* method to print the temperature
* method to print the temperature
* and the sky condition of current day + 5
* in 3 hour segments
* @param i timestamps for weatherdata
......@@ -15,14 +15,19 @@ public class WeatherOutput {
for (int i = 0; i < weatherObject.getList().length - 1; i++) {
System.out.print(weatherObject.getList()[i].getDtTxt() + ": "); // output nicht wie bei Goik
double timeStamp = weatherObject.getList()[i].getDt();
if ((weatherObject.getList()[i].getDtTxt().substring(11, 13).equals("00")) || i == 0 ) {
System.out.println(weatherObject.getList()[i].getDtTxt().substring(0, 10));
}
System.out.print(weatherObject.getList()[i].getDtTxt().substring(11, 13) + " Uhr: ");
// System.out.print(weatherObject.getList()[i].getDtTxt() + ": "); // output nicht wie bei Goik
/* double timeStamp = weatherObject.getList()[i].getDt();
timeStamp = timeStamp;
System.out.println(timeStamp);
// January 1, 1970 00:00:00.000 GMT
// January 1, 1970 00:00:00.000 GMT */
Main MainWeatherData = weatherObject.getList()[i].getMain();
System.out.print(Math.round(MainWeatherData.getTemp()) + "°C");
System.out.print(Math.round(MainWeatherData.getTemp()) + "°C,");
Clouds SkyCondition = weatherObject.getList()[i].getClouds();
int SkyPercent = SkyCondition.getAll();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment