Changeset 851:b98050aeebf9
- Timestamp:
- 05/21/17 07:42:00 (8 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r850 r851 9 9 import os 10 10 import time 11 import calendar 11 12 12 13 #----------------------------------------------------------------------------- … … 338 339 tm = time.gmtime(timestamp) 339 340 self.set_text("%02d:%02d" % (tm.tm_hour, tm.tm_min)) 341 342 def getTimestampFrom(self, timestamp): 343 """Get the timestamp by replacing the hour and minute from the given 344 timestamp with what is set in this widget.""" 345 tm = time.gmtime(timestamp) 346 ts = calendar.timegm((tm.tm_year, tm.tm_mon, tm.tm_mday, 347 self.hour, self.minute, 0, 348 tm.tm_wday, tm.tm_yday, tm.tm_isdst)) 349 350 if ts > (timestamp + (16*60*60)): 351 ts -= 24*60*60 352 elif (ts + 16*60*60) < timestamp: 353 ts += 24*60*60 354 355 return ts 340 356 341 357 def _focusOutEvent(self, widget, event):
Note:
See TracChangeset
for help on using the changeset viewer.