diff --git a/cell.go b/cell.go index 6d0c2aba..b4314b91 100644 --- a/cell.go +++ b/cell.go @@ -307,7 +307,7 @@ func (c *Cell) SetDateTime(t time.Time) { func (c *Cell) SetDateWithOptions(t time.Time, options DateTimeOptions) { c.updatable() _, offset := t.In(options.Location).Zone() - t = time.Unix(t.Unix()+int64(offset), 0) + t = time.Unix(t.Unix()+int64(offset), int64(t.Nanosecond())) c.SetDateTimeWithFormat(TimeToExcelTime(t.In(timeLocationUTC), c.date1904), options.ExcelTimeFormat) c.modified = true }