Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestAddDate (0.18 sec)

  1. src/time/time_test.go

    // to
    // Thu Mar 19 7:56:35 PST 2016
    var addDateTests = []struct {
    	years, months, days int
    }{
    	{4, 4, 1},
    	{3, 16, 1},
    	{3, 15, 30},
    	{5, -6, -18 - 30 - 12},
    }
    
    func TestAddDate(t *testing.T) {
    	t0 := Date(2011, 11, 18, 7, 56, 35, 0, UTC)
    	t1 := Date(2016, 3, 19, 7, 56, 35, 0, UTC)
    	for _, at := range addDateTests {
    		time := t0.AddDate(at.years, at.months, at.days)
    		if !time.Equal(t1) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
Back to top