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 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案