doujiyan0971 2018-08-24 12:19
浏览 316

如何将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"

  • 写回答

1条回答

  • dongzhitao4839 2018-08-24 13:28
    关注

    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
    
    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题