mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	#1500 timezone minutes offset
This commit is contained in:
		@@ -5,7 +5,7 @@ Gogs - Go Git Service [ is a painless self-hosted Git service.
 | 
					Gogs (Go Git Service) is a painless self-hosted Git service.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##### Current version: 0.6.9 Beta
 | 
					##### Current version: 0.6.11 Beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<table>
 | 
					<table>
 | 
				
			||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							@@ -17,7 +17,7 @@ import (
 | 
				
			|||||||
	"github.com/gogits/gogs/modules/setting"
 | 
						"github.com/gogits/gogs/modules/setting"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const APP_VER = "0.6.10.0910 Beta"
 | 
					const APP_VER = "0.6.11.0911 Beta"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
						runtime.GOMAXPROCS(runtime.NumCPU())
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,12 +54,13 @@ func regulateTimeZone(t time.Time) time.Time {
 | 
				
			|||||||
	if len(zone) != 5 {
 | 
						if len(zone) != 5 {
 | 
				
			||||||
		return t
 | 
							return t
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	offset := com.StrTo(zone[2:3]).MustInt()
 | 
						hour := com.StrTo(zone[2:3]).MustInt()
 | 
				
			||||||
 | 
						minutes := com.StrTo(zone[3:4]).MustInt()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if zone[0] == '-' {
 | 
						if zone[0] == '-' {
 | 
				
			||||||
		return t.Add(time.Duration(offset) * time.Hour)
 | 
							return t.Add(time.Duration(hour) * time.Hour).Add(time.Duration(minutes) * time.Minute)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return t.Add(-1 * time.Duration(offset) * time.Hour)
 | 
						return t.Add(-1 * time.Duration(hour) * time.Hour).Add(-1 * time.Duration(minutes) * time.Minute)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1 +1 @@
 | 
				
			|||||||
0.6.10.0910 Beta
 | 
					0.6.11.0911 Beta
 | 
				
			||||||
		Reference in New Issue
	
	Block a user