I'm trying to get the current day/month/year in an Android App in react-native.
This is what i've done:
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());
And in the console I have:
Date:Fri Jun 16 2017 11:27:36 GMT+0000 (GMT)
'Day: 5', 'Month: 5', 'Year :117'
As you see, getDay()
, getMonth()
and getYear()
don't return what I want...