A rotating mechanism for a foldable electronic device that comprises a foldable display, the rotating mechanism comprising a fixed base, a flexible support member, a first rotating member, and a second rotating member, wherein the fixed base is provided with a first rotating groove and a second rotating groove, the first rotating groove and the second rotating groove are disposed opposite to each other, the flexible support member comprises a first side portion and a second side portion, the first side portion and the second side portion are respectively located on two opposite sides of the flexible support member, and the flexible support member is located on a surface of the fixed base; the first rotating member comprises a first swingarm, the first swingarm comprises a first rotating body and a first rotating portion, the first rotating body is fixedly connected to the first rotating portion, the first rotating portion is rotatably connected to the first side portion of the flexible support member, and the first rotating body is installed in the first rotating groove and capable of sliding along the first rotating groove; and the second rotating member comprises a second swingarm, the second swingarm comprises a second rotating body and a second rotating portion, the second rotating body is fixedly connected to the second rotating portion, the second rotating portion is rotatably connected to the second side portion of the flexible support member, the second rotating body is installed in the second rotating groove and capable of sliding along the second rotating groove; and rotation directions of the first rotating member and the second rotating member relative to the flexible support member are opposite, wherein the rotating mechanism has an unfolded state and a folded state, and when the rotating mechanism is in the folded state, the flexible support member is bent to form avoidance space so as to accommodate a display of a foldable electronic device comprising the rotating mechanism. the fixed base is provided with a first rotating groove and a second rotating groove, the first rotating groove and the second rotating groove are disposed opposite to each other, the flexible support member comprises a first side portion and a second side portion, the first side portion and the second side portion are respectively located on two opposite sides of the flexible support member, and the flexible support member is located on a surface of the fixed base; the first rotating member comprises a first swingarm, the first swingarm comprises a first rotating body and a first rotating portion, the first rotating body is fixedly connected to the first rotating portion, the first rotating portion is rotatably connected to the first side portion of the flexible support member, and the first rotating body is installed in the first rotating groove and capable of sliding along the first rotating groove; and the second rotating member comprises a second swingarm, the second swingarm comprises a second rotating body and a second rotating portion, the second rotating body is fixedly connected to the second rotating portion, the second rotating portion is rotatably connected to the second side portion of the flexible support member, the second rotating body is installed in the second rotating groove and capable of sliding along the second rotating groove; and rotation directions of the first rotating member and the second rotating member relative to the flexible support member are opposite, wherein the rotating mechanism has an unfolded state and a folded state, and when the rotating mechanism is in the folded state, the flexible support member is bent to form avoidance space so as to accommodate a display of a foldable electronic device comprising the rotating mechanism.