在轨

2017-10-05 51 views
1

时间从Salesforce返回销售人员UTC时间转换为这种格式2017-07-14T12:02:23.000+0000但我想是的updated_at Wed, 04 Oct 2017 23:00:45 PDT -07:00 我试图把它与time_var.utc转换成UTC我保存的时间转换,但它返回2017-10-05 06:00:45 UTC 哪有我让时间在Salesforce格式2017-07-14T12:02:23.000+0000在轨

+0

你可能会在专用StackExchange更好地帮助发帖:https://salesforce.stackexchange.com –

+0

我试图用Ruby转换在轨道上。 Salesforce的时间格式不会改变/或我们必须遵循相同的格式 –

+0

请将您的代码添加到问题中,这将有助于了解错误信息 –

回答

1

time_in_utc = DateTime.parse product.updated_at.utc.to_s last_update_time = time_in_utc.iso8601

1
updated_at = "Wed, 04 Oct 2017 23:00:45:032 PDT -07:00" 
Time.parse(updated_at).utc.strftime("%Y-%m-%dT%T.%L%z")