agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
693 stars 236 forks source link

Some cameras not return UTCDateTime, but return localDateTime, please correct #160

Closed vvvait closed 3 years ago

vvvait commented 4 years ago
var sysDT = data[0]['getSystemDateAndTimeResponse'][0]['systemDateAndTime'][0];
sysDT = sysDT['UTCDateTime'] ? sysDT['UTCDateTime'][0] : sysDT['localDateTime'][0];
var dt = linerase(sysDT)
chriswiggins commented 4 years ago

Please submit a PR rather than asking us to do this for you if you've already worked out a solution :-)

vvvait commented 4 years ago

i am noob in git, sorry :(

dzek69 commented 4 years ago

Funny thing, years ago I disovered this issue with this library, never really had a time to play with my camera anyway. Today I wanted to see if this is working now and saw it is not. So I fixed the problem and found this particular issue reported several days ago. Like... for years nobody had this issue, but when I had it, somebody else also had it.

Anyway, @vvvait, you can use my fix before this gets merged and released as new version by putting this in your package.json "onvif": "dzek69/onvif#dateTimeFix", so you won't have to edit node_modules files each time you do npm install