package utils

import (
	"testing"
)

func TestJavaDate(t *testing.T) {
	var (
		date interface{}
		jd   *JavaDate
	)
	err := UnmarshalUseNumber([]byte(`
	{
        "date":6,
        "day":1,
        "hours":9,
        "minutes":45,
        "month":4,
        "seconds":46,
        "time":1557107146000,
        "timezoneOffset":-480,
        "year":119
    }	
	`), &date)
	if err != nil {
		t.Fatal(err)
	}
	err = Map2StructByJson(date, &jd, false)
	if err != nil {
		t.Fatal(err)
	}
	t.Log(jd.GoTime())
	t.Log(Format4Output(jd, false))

	jd = NewJavaDateFromTime(jd.GoTime())
	t.Log(jd.GoTime())
	t.Log(Format4Output(jd, false))
}
