This is my code:
var feedDataTimestamp = new Date("2014-01-14T00:04:40+0000").getTime();
var parsedDate = new Date(+feedDataTimestamp);
alert(parsedDate.getHours());
but it should print 0, not 1: time is 00:04:40
Dates are an excellent source of vitamin C and D which helps to maintain your skin elasticity and keeps your skin smooth. Dates also come with anti-ageing properties and prevent the accumulation of melanin.
Dates are a source of bone-friendly minerals including phosphorus, potassium, calcium and magnesium. They are also a source of vitamin K which is needed for healthy, strong bones.
“Eating dates will promote sperm quality and quantity as it is one of the best natural fruits used for male fertility. “It also increases the size of testes in men and the size of breast in women. “Consuming the fruit can help to treat sexual disorders because it is a natural aphrodisiac.”
They are high in several nutrients, fiber and antioxidants, all of which may provide health benefits ranging from improved digestion to a reduced risk of disease. There are several ways to add dates to your diet. One popular way to eat them is as a natural sweetener in various dishes. They also make a great snack.
Because you (according to your Stackoverflow profile) are in Italy, so your time zone is UTC+1.
The time stamp you are inputting is UTC+0.
parsedDate
will be in local time.
Use the getUTCHours()
method if you want to get UTC time instead of local time.
You set the timezone in the parsed string as +0000
so you seem to want the hours in UTC, use
alert(parsedDate.getUTCHours())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With