|
|
@@ -114,21 +114,21 @@ func (c *Cell) SetFloatWithFormat(n float64, format string) {
|
|
|
|
|
|
var timeLocationUTC, _ = time.LoadLocation("UTC")
|
|
|
|
|
|
-func timeToUTCTime(t time.Time) time.Time {
|
|
|
+func TimeToUTCTime(t time.Time) time.Time {
|
|
|
return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), timeLocationUTC)
|
|
|
}
|
|
|
|
|
|
-func timeToExcelTime(t time.Time) float64 {
|
|
|
+func TimeToExcelTime(t time.Time) float64 {
|
|
|
return float64(t.Unix())/86400.0 + 25569.0
|
|
|
}
|
|
|
|
|
|
// SetDate sets the value of a cell to a float.
|
|
|
func (c *Cell) SetDate(t time.Time) {
|
|
|
- c.SetDateTimeWithFormat(float64(int64(timeToExcelTime(timeToUTCTime(t)))), builtInNumFmt[14])
|
|
|
+ c.SetDateTimeWithFormat(float64(int64(TimeToExcelTime(TimeToUTCTime(t)))), builtInNumFmt[14])
|
|
|
}
|
|
|
|
|
|
func (c *Cell) SetDateTime(t time.Time) {
|
|
|
- c.SetDateTimeWithFormat(timeToExcelTime(timeToUTCTime(t)), builtInNumFmt[22])
|
|
|
+ c.SetDateTimeWithFormat(TimeToExcelTime(TimeToUTCTime(t)), builtInNumFmt[22])
|
|
|
}
|
|
|
|
|
|
func (c *Cell) SetDateTimeWithFormat(n float64, format string) {
|