mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Correctly use our "localtime"
We use time stamps without timezone, so we need to correct for the current time zone offset before showing dates and times in time zone aware widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									3de498b466
								
							
						
					
					
						commit
						a925e677f1
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -391,8 +391,9 @@ void MainTab::updateDiveInfo(int dive) | |||
| 	UPDATE_TEMP(d, watertemp); | ||||
| 	if (d) { | ||||
| 		updateGpsCoordinates(d); | ||||
| 		ui.dateEdit->setDate(QDateTime::fromTime_t(d->when).date()); | ||||
| 		ui.timeEdit->setTime(QDateTime::fromTime_t(d->when).time()); | ||||
| 		QDateTime localTime = QDateTime::fromTime_t(d->when - gettimezoneoffset()); | ||||
| 		ui.dateEdit->setDate(localTime.date()); | ||||
| 		ui.timeEdit->setTime(localTime.time()); | ||||
| 		if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) { | ||||
| 			setTabText(0, tr("Trip Notes")); | ||||
| 			// only use trip relevant fields
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue