Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法通过Python API更改Picasa网络相册的日期_Python_Api_Gdata_Picasa - Fatal编程技术网

无法通过Python API更改Picasa网络相册的日期

无法通过Python API更改Picasa网络相册的日期,python,api,gdata,picasa,Python,Api,Gdata,Picasa,我无法通过Python API更改Picasa网络相册的日期。我花了很多时间在这件事上,现在我绝望了。代码: # set values remote_album.timestamp.text = str(get_published_as_timestamp()) remote_album.published.text = published + 'T04:01:01.000Z' # test before print remote_album.published print remote_al

我无法通过Python API更改Picasa网络相册的日期。我花了很多时间在这件事上,现在我绝望了。代码:

# set values
remote_album.timestamp.text = str(get_published_as_timestamp())
remote_album.published.text = published + 'T04:01:01.000Z'

# test before
print remote_album.published
print remote_album.published.text
print remote_album.timestamp.text

# save it remotely
remote_album = picasa.Put(remote_album, remote_album.GetEditLink().href, converter=gdata.photos.AlbumEntryFromString)

# test after
print remote_album.published.text
print remote_album.timestamp.text

# :'-(
输出为:

<ns0:published xmlns:ns0="http://www.w3.org/2005/Atom">2010-12-24T04:01:01.000Z</ns0:published>
2010-12-24T04:01:01.000Z
1293148000
1970-01-15T23:12:28.000Z
1293148000
2010-12-24T04:01:01.000Z
2010-12-24T04:01:01.000Z
1293148000
1970-01-15T23:12:28.000Z
1293148000

我可以按如下方式更改我的相册时间戳:

album.timestamp = gdata.photos.Timestamp(
    text="%d000" % time.mktime((2010, 02, 03, 12, 00, 00, -1, -1, -1)))
updated_album = gd_client.Put(
    album, 
    album.GetEditLink().href, 
    converter=gdata.photos.AlbumEntryFromString)
显然,我的代码与您的不同(我今天才刚刚开始使用gdataapi),但它展示了如何创建一个新的timestamp对象并将其分配给相册timestamp