Python strptime : time data 'January 03 2017' does not match format '%b %d %Y'
^^ code ^^
//array
var t = ["house","pen","table","eletronic"];
//-> selected a name option 0
var w = t[0]; // selected
var x = w;
var y = 0 to 3; // random
var house =["red","blue","orange","black"];
var pen =["silver", "gold", "cooper","plastic"];
var table =["marble","oak","yep","pine"];
var eletro=["computer","mobile","mac","tablet"];
// what i wish
var z = house[0]; // return red // x = typeof return object
//x this is the error type string not recognize list array query
var z = x[y]; // x = typeof return string
var z = "house"[0]; // return h - return string - not object
//after make a default
var a = x[y]; //y != y
var b = x[y]; //y != y
document.getElementById("demo1").innerHTML=z; // blue house;
document.getElementById("demo2").innerHTML=a; // silver pen;
document.getElementById("demo3").innerHTML=b; // marble table;
^^错误^^
运行Python 2.7
我知道已经提出了类似的问题,但没有一个答案符合我的情况。
答案 0 :(得分:2)
仔细看看docs(强调我的):
%b - 月份作为区域设置的缩写名称。 (Jan,Feb,...,Dec)
%B - 月份作为区域设置的完整名称。 (1月,2月,...,12月)
您需要'%B %d %Y'
,而不是'%b %d %Y'
。
答案 1 :(得分:1)
%b
用于缩写的月份名称。你想要%B
。