Browse Source

Merge pull request #284 from simulot/master

TimeToExcelTime is tuncating time to second
Geoffrey J. Teale 8 years ago
parent
commit
47e33bbbed
1 changed files with 1 additions and 1 deletions
  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 {
-	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.