Author

Topic: time field on a transaction using javascript (Read 632 times)

sr. member
Activity: 335
Merit: 250
Is objectTransaction.time a unix timestamp? The Date constructor requires timestamps in milliseconds, so you need to do:

Code:
new Date(objectTransaction.time * 1000).toUTCString()

lol I knew it was something stupid Smiley ty Smiley
vip
Activity: 198
Merit: 101
Is objectTransaction.time a unix timestamp? The Date constructor requires timestamps in milliseconds, so you need to do:

Code:
new Date(objectTransaction.time * 1000).toUTCString()
sr. member
Activity: 335
Merit: 250
I'm certain this is a facepalm moment, but I'm trying to convert the json time field on a transaction using javascript and can't figure out wtf I'm doing wrong. .. fml moment

new Date(objectTransaction.time).toUTCString()

returns a date in 1970, obviously this is not correct

please help Smiley
Jump to: