kubernetes-cronhpa-controller icon indicating copy to clipboard operation
kubernetes-cronhpa-controller copied to clipboard

why use "11-15-1990" as dataFormat?

Open yimi-k opened this issue 8 months ago • 0 comments

When judging whether it is an excluded date, "11-15-1990" is used as the format of the formatting time. The time formatted in this way is weird, and the DAY is not included, so why use formatStr instead of "01-02-2006"?

====== Test ====== code:

func TestFormat(t *testing.T) {
	format1, format2 := dateFormat, "01-02-2006"
	now := time.Now()
	log.Println(" ===> now: " + now.String())
	log.Println(" ===> format1: " + now.Format(format1))
	log.Println(" ===> format2: " + now.Format(format2))
}

output:

2025/02/17 20:44:11  ===> now: 2025-02-17 20:44:11.3782458 +0800 CST m=+0.028673801
2025/02/17 20:44:11  ===> format1: 22-20-2990
2025/02/17 20:44:11  ===> format2: 02-17-2025

===============

yimi-k avatar Feb 17 '25 12:02 yimi-k