My first thought is try logging to the console with beginEditingLastUpdate.getTime() as this will give you a result accurate to the microsecond, instead of the iso-format string which is only displays with an accuracy of one second. I'd say there's a difference between the two times but it's less than one second.
I'm not sure why you're seeing invalid date, however if you're calling new Date() - ie with the new keyword and no arguments - it would certainly be unusual to see InvalidDate. If you're calling new Date(some_value) please provide what some_value is.
edit: If you can provide the context of how you're using yourdate.proto I may be able to better respond to part 2 of your question. As a guess, if you're checking if an object is a date, try using
yourdate instanceof Date // returns true if yourdate is a Date object