1
私は反応ネイティブのAndroidアプリケーションで現在の日/月/年を取得しようとしています。反応ネイティブを取得する日
これは私が何をやったかである:
currentDay: new Date(),
...
console.log('Date:'+this.state.currentDay ,);
console.log('Day: '+this.state.currentDay.getDay() , 'Month: ' + this.state.currentDay.getMonth(), 'Year :'+ this.state.currentDay.getYear());
そして、私が持っているコンソールで:
Date:Fri Jun 16 2017 11:27:36 GMT+0000 (GMT)
'Day: 5', 'Month: 5', 'Year :117'
ご覧のとおり、getDay()
、getMonth()
とgetYear()
は私が欲しいものを返しません。 ..
'.getYear()'の代わりに '.getFullYear()'がほしいと思うかもしれません。 – Kerumen