I have written a service for connecting the Salesforce from Go, but the problem is I am unable to store the data in data type of DATE in Salesforce.
Does anyone have experience you can share with us?
DATE format in salesforce is ddmmyyyy(08/23/2018)
How can I get the same format in go?
This the field i have to insert in salesforce I am sending string as my date. kinApplicationForm.DutyEndDate = Time().Format("8/23/2018")
Error: *http.Response=&{400 Bad Request 400 and is taking date as in this format "DutyEndDate__c":"8/246/24088"
Read the Go package time documentation for time layouts.
For example,
package main
import (
"fmt"
"time"
)
func main() {
t := time.Now().Round(0)
fmt.Println(t)
sf := t.Format("01/02/2006")
fmt.Println(sf)
}
Playground: https://play.golang.org/p/EX1ksiKcmKN
Output:
2009-11-10 23:00:00 +0000 UTC
11/10/2009