func (d *Datetime) ToTime() *time.Time {
	if d == nil {
		return nil
	}
	return &d.Time
}
ToTime Datetime 2 *time.Time
Author SliverHorn
package types
import (
	"database/sql"
	"database/sql/driver"
	"fmt"
	"go.uber.org/zap"
	"time"
)
const DateTimeFormat = "2006-01-02 15:04:05"
type Datetime struct {
	time.Time
}
func NewDatetime(value string) *Datetime {
	_time, _ := time.Parse(DateTimeFormat, value)
	return &Datetime{Time: _time}
}
func NewDatetimeByLayout(layout, value string) *Datetime {
	_time, _ := time.Parse(layout, value)
	_d := &Datetime{Time: _time}
	return _d
}
func (d *Datetime) ToDate() *Date {
	if d == nil {
		return nil
	}
	return &Date{Time: d.Time}
}