本文整理汇总了Python中simple_salesforce.util.date_to_iso8601函数的典型用法代码示例。如果您正苦于以下问题:Python date_to_iso8601函数的具体用法?Python date_to_iso8601怎么用?Python date_to_iso8601使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了date_to_iso8601函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_date_to_iso8601
def test_date_to_iso8601(self):
date = datetime.datetime(2014, 3, 22, 00, 00, 00, 0, tzinfo=pytz.UTC)
result = date_to_iso8601(date)
expected = "2014-03-22T00%3A00%3A00%2B00%3A00"
self.assertEquals(result, expected)
date = datetime.datetime(2014, 3, 22, 00, 00, 00, 0, tzinfo=pytz.timezone("America/Phoenix"))
result = date_to_iso8601(date)
expected = "2014-03-22T00%3A00%3A00-07%3A00"
self.assertEquals(result, expected)
开发者ID:rmonk,项目名称:simple-salesforce,代码行数:10,代码来源:test_util.py
示例2: deleted
def deleted(self, start, end):
"""Use the SObject Get Deleted resource to get a list of deleted records for the specified object.
.../deleted/?start=2013-05-05T00:00:00+00:00&end=2013-05-10T00:00:00+00:00
* start -- start datetime object
* end -- end datetime object
"""
url = self.base_url + 'deleted/?start={start}&end={end}'.format(
start=date_to_iso8601(start), end=date_to_iso8601(end))
result = self._call_salesforce('GET', url)
return result.json(object_pairs_hook=OrderedDict)
开发者ID:nickcatal,项目名称:simple-salesforce,代码行数:11,代码来源:api.py
示例3: test_date_to_iso8601
def test_date_to_iso8601(self):
date = pytz.UTC.localize(datetime.datetime(2014, 3, 22, 00, 00, 00, 0))
result = date_to_iso8601(date)
expected = '2014-03-22T00%3A00%3A00%2B00%3A00'
self.assertEquals(result, expected)
date = pytz.timezone('America/Phoenix').localize(
datetime.datetime(2014, 3, 22, 00, 00, 00, 0))
result = date_to_iso8601(date)
expected = '2014-03-22T00%3A00%3A00-07%3A00'
self.assertEquals(result, expected)
开发者ID:ajoys,项目名称:simple-salesforce,代码行数:11,代码来源:test_util.py
示例4: updated
def updated(self, start, end):
"""Use the SObject Get Updated resource to get a list of updated (modified or added)
records for the specified object.
.../updated/?start=2014-03-20T00:00:00+00:00&end=2014-03-22T00:00:00+00:00
* start -- start datetime object
* end -- end datetime object
"""
url = self.base_url + "updated/?start={start}&end={end}".format(
start=date_to_iso8601(start), end=date_to_iso8601(end)
)
result = self._call_salesforce("GET", url)
return result.json(object_pairs_hook=OrderedDict)
开发者ID:rmonk,项目名称:simple-salesforce,代码行数:14,代码来源:api.py
示例5: updated
def updated(self, start, end):
"""Use the SObject Get Updated resource to get a list of updated (modified or added)
records for the specified object.
.../updated/?start=2014-03-20T00:00:00+00:00&end=2014-03-22T00:00:00+00:00
* start -- start datetime object
* end -- end datetime object
"""
url = self.base_url + 'updated/?start={start}&end={end}'.format(
start=date_to_iso8601(start), end=date_to_iso8601(end))
result = self._call_salesforce('GET', url)
#Python 2.6 doesn't like OrderedDict
if sys.version_info[0:2] <= (2, 6):
return result.json()
return result.json(object_pairs_hook=OrderedDict)
开发者ID:nicholas-brown,项目名称:simple-salesforce,代码行数:16,代码来源:api.py
示例6: updated
def updated(self, start, end):
# pylint: disable=line-too-long
"""Gets a list of updated records
Use the SObject Get Updated resource to get a list of updated
(modified or added) records for the specified object.
.../updated/?start=2014-03-20T00:00:00+00:00&end=2014-03-22T00:00:00+00:00
* start -- start datetime object
* end -- end datetime object
"""
url = self.base_url + 'updated/?start={start}&end={end}'.format(
start=date_to_iso8601(start), end=date_to_iso8601(end))
result = self._call_salesforce('GET', url)
#return result.json(object_pairs_hook=OrderedDict)
return result.json()
开发者ID:elationemr,项目名称:simple-salesforce,代码行数:17,代码来源:api.py
示例7: deleted
def deleted(self, start, end, headers=None):
# pylint: disable=line-too-long
"""Gets a list of deleted records
Use the SObject Get Deleted resource to get a list of deleted records
for the specified object.
.../deleted/?start=2013-05-05T00:00:00+00:00&end=2013-05-10T00:00:00+00:00
* start -- start datetime object
* end -- end datetime object
* headers -- a dict with additional request headers.
"""
url = urljoin(
self.base_url, 'deleted/?start={start}&end={end}'.format(
start=date_to_iso8601(start), end=date_to_iso8601(end)
)
)
result = self._call_salesforce(method='GET', url=url, headers=headers)
return result.json(object_pairs_hook=OrderedDict)
开发者ID:demianbrecht,项目名称:simple-salesforce,代码行数:19,代码来源:api.py
注:本文中的simple_salesforce.util.date_to_iso8601函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论