Ver Fonte

TimeToExcelTime is tuncating time to second

simulot há 8 anos atrás
pai
commit
c3cef27bce
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      cell.go

+ 1 - 1
cell.go

@@ -119,7 +119,7 @@ func TimeToUTCTime(t time.Time) time.Time {
 }
 }
 
 
 func TimeToExcelTime(t time.Time) float64 {
 func TimeToExcelTime(t time.Time) float64 {
-	return float64(t.Unix())/86400.0 + 25569.0
+	return float64(t.UnixNano())/8.64e13 + 25569.0
 }
 }
 
 
 // SetDate sets the value of a cell to a float.
 // SetDate sets the value of a cell to a float.