At least in my environment (ruby 1.9.2) Time.now.to_s produces a string like: 2012-05-11 18:07:48 +0200
In Safari this is not parsable with new Date():
> new Date('2012-05-11 18:07:48 +0200');
> Invalid Date
In general the timestamp format of Time.now.to_s differs between ruby versions, so I think its best to enforce a specific format that is known to work in all browser.
At least in my environment (ruby 1.9.2)
Time.now.to_s
produces a string like: 2012-05-11 18:07:48 +0200In Safari this is not parsable with
new Date()
:In general the timestamp format of
Time.now.to_s
differs between ruby versions, so I think its best to enforce a specific format that is known to work in all browser.