mirror of
				https://github.com/solero/houdini.git
				synced 2025-10-31 04:32:07 +00:00 
			
		
		
		
	Calculate timezone offset for daylight savings time
This commit is contained in:
		| @@ -25,6 +25,8 @@ if __name__ == '__main__': | ||||
|                         nargs='*', help='Plugins to load') | ||||
|     parser.add_argument('-l', '--lang', action='store', default='en', help='Houdini language', | ||||
|                         choices=['en', 'fr', 'pt', 'es', 'de', 'ru']) | ||||
|     parser.add_argument('-tz', '--timezone', action='store', default='America/Vancouver', | ||||
|                         help='Server timezone') | ||||
|  | ||||
|     login_group = parser.add_argument_group('login') | ||||
|     login_group.add_argument('--login-failure-limit', action='store', default=5, help='Limit before flood limit', | ||||
|   | ||||
| @@ -29,7 +29,10 @@ async def handle_join_server(p, penguin_id: int, login_key: str): | ||||
|  | ||||
|     current_time = int(time.time()) | ||||
|     penguin_standard_time = current_time * 1000 | ||||
|     server_time_offset = 7 | ||||
|  | ||||
|     pst = pytz.timezone(p.server.config.timezone) | ||||
|     dt = datetime.fromtimestamp(current_time, pst) | ||||
|     server_time_offset = abs(int(dt.strftime('%z')) // 100) | ||||
|  | ||||
|     if p.timer_active: | ||||
|         minutes_until_timer_end = datetime.combine(datetime.today(), p.timer_end) - datetime.now() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ben
					Ben