如何将DATE转换为salesforce中的数据类型DATE

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"

dsnm64969
dsnm64969 你尝试了什么?包括您的代码。您正面临什么问题?您的输出或错误是什么,您期望得到什么?
大约 2 年之前 回复

1个回答



阅读转到 打包时间文档(用于时间布局)。</ p>

例如</ p>

 打包主文件

import(
“ fmt “
” time“

func main(){
t:= time.Now()。Round(0)
fmt.Println(t)
sf:= t.Format(” 01 / 02/2006“)
fmt.Println(sf)
}
</ code> </ pre>

游乐场: https://play.golang.org/p/EX1ksiKcmKN </ p>

输出:</ p>

  2009-11-10 23:00:00 +0000 UTC 
11 / 10/2009
</ code> </ pre>
</ div>

展开原文

原文

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

dongnaoben4456
dongnaoben4456 我也无法以这些格式将数据存储在Salesforce中
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐