小编Dea*_*pha的帖子

如何通过javascript将unix纪元转换为[年、月、日]

我有一个小需求,我想将存储在变量中的时间戳转换doc.creation_time为格式[year,month,day]

例子:

doc.creation_time=1537492812 这应该转换为[2018,38,Fri]

有人可以帮忙吗

javascript

1
推荐指数
1
解决办法
2646
查看次数

Creating a dictionary from a dict & list

I have a dictionary & a list as follows.

>>> new_coins
{'main': '100', 'single': '10'}
>>> get_snip_priority('prod-oregon')
['prod-singapore', 'prod-delhi']
Run Code Online (Sandbox Code Playgroud)

I need the best efficient way to create a dictionary using the above 2 data structs as follows:

{
main : { 
        'prod-singapore': 100, # 100 is the value of main 
        'prod-delhi': 100 }, 
single: {
        'prod-singapore': 10, # 10 is the value of static 
        'prod-delhi': 10 }, 
Run Code Online (Sandbox Code Playgroud)

can some one help

python dictionary

0
推荐指数
1
解决办法
55
查看次数

标签 统计

dictionary ×1

javascript ×1

python ×1