Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for Format (0.18 sec)

  1. tests/update_has_one_test.go

    	}
    
    	var user4 User
    	DB.Preload("Account").Find(&user4, "id = ?", user.ID)
    
    	if lastUpdatedAt.Format(time.RFC3339) == user4.Account.UpdatedAt.Format(time.RFC3339) {
    		t.Fatalf("updated at should be updated, but not, old: %v, new %v", lastUpdatedAt.Format(time.RFC3339), user3.Account.UpdatedAt.Format(time.RFC3339))
    	} else {
    		user.Account.UpdatedAt = user4.Account.UpdatedAt
    		CheckUser(t, user4, user)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  2. logger/sql.go

    		case time.Time:
    			if v.IsZero() {
    				vars[idx] = escaper + tmFmtZero + escaper
    			} else {
    				vars[idx] = escaper + v.Format(tmFmtWithMS) + escaper
    			}
    		case *time.Time:
    			if v != nil {
    				if v.IsZero() {
    					vars[idx] = escaper + tmFmtZero + escaper
    				} else {
    					vars[idx] = escaper + v.Format(tmFmtWithMS) + escaper
    				}
    			} else {
    				vars[idx] = nullStr
    			}
    		case driver.Valuer:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  3. utils/tests/utils.go

    		isEqual := func() {
    			if curTime, ok := got.(time.Time); ok {
    				format := "2006-01-02T15:04:05Z07:00"
    
    				if curTime.Round(time.Second).UTC().Format(format) != expect.(time.Time).Round(time.Second).UTC().Format(format) && curTime.Truncate(time.Second).UTC().Format(format) != expect.(time.Time).Truncate(time.Second).UTC().Format(format) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 10 09:21:56 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  4. logger/sql_test.go

    		},
    		{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  5. tests/upsert_test.go

    	DB.Where(&User{Name: "find or create 3"}).Assign("age", 55).FirstOrCreate(&user4)
    
    	if user4.Age != 55 {
    		t.Errorf("Failed to set change to 55, got %v", user4.Age)
    	}
    
    	if updatedAt1.Format(time.RFC3339Nano) == user4.UpdatedAt.Format(time.RFC3339Nano) {
    		t.Errorf("UpdateAt should be changed when update values with assign")
    	}
    
    	DB.Where(&User{Name: "find or create 4"}).Assign(User{Age: 44}).FirstOrCreate(&user4)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  6. chainable_api.go

    	} else {
    		tx.Statement.Omits = columns
    	}
    	return
    }
    
    // Where add conditions
    //
    // See the [docs] for details on the various formats that where clauses can take. By default, where clauses chain with AND.
    //
    //	// Find the first user with name jinzhu
    //	db.Where("name = ?", "jinzhu").First(&user)
    //	// Find the first user with name jinzhu and age 20
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  7. tests/update_test.go

    		t.Errorf("User2's name should be updated")
    	}
    
    	if user2.UpdatedAt.Format(time.RFC1123Z) == user3.UpdatedAt.Format(time.RFC1123Z) {
    		t.Errorf("User's updated at should be changed, old %v, new %v", user2.UpdatedAt.Format(time.RFC1123Z), user3.UpdatedAt.Format(time.RFC1123Z))
    	}
    
    	// update with gorm exprs
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  8. tests/default_value_test.go

    		t.Fatalf("Failed to create data with default value, got error: %v", err)
    	} else if harumph.Name != "foo" || harumph.Name2 != "foo" || harumph.Name3 != "" || harumph.Age != 18 || !harumph.Enabled || harumph.Created.Format("20060102") != "20000102" {
    		t.Fatalf("Failed to create data with default value, got: %+v", harumph)
    	}
    
    	var result Harumph
    	if err := DB.First(&result, "email = ?", "******@****.***").Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  9. tests/non_std_test.go

    	}
    
    	animal := Animal{Name: "Ferdinand"}
    	DB.Save(&animal)
    	updatedAt1 := animal.UpdatedAt
    
    	DB.Save(&animal).Update("name", "Francis")
    	if updatedAt1.Format(time.RFC3339Nano) == animal.UpdatedAt.Format(time.RFC3339Nano) {
    		t.Errorf("UpdatedAt should be updated")
    	}
    
    	var animals []Animal
    	DB.Find(&animals)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  10. schema/field.go

    		if v != "<-" {
    			if !strings.Contains(v, "create") {
    				field.Creatable = false
    			}
    
    			if !strings.Contains(v, "update") {
    				field.Updatable = false
    			}
    		}
    	}
    
    	// Normal anonymous field or having `EMBEDDED` tag
    	if _, ok := field.TagSettings["EMBEDDED"]; ok || (field.GORMDataType != Time && field.GORMDataType != Bytes && !isValuer &&
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top