Fix AM::Serializers::JSON#as_json method for timestamps
#31503

bogdan wants to merge bogdan:timestamp-as-json into rails:master

We do not currently have an analysis of these two commits