Reading transform.rotation returning wrong value

I am writing Objects to a MySQL database which is working but the rotation of the object is is wrong for example the Rotation on Y of the object is 45.00000 but the value being set in the Debug.Log is “Transform Y: -0.9704478”

On this transform there is no value that anywhere that this value equals I have no idea where it is coming from.

    void prepData()
    {
        bodies = GameObject.FindGameObjectsWithTag("Savable");
        _GameItems = new List<data>();
        data itm;
        foreach (GameObject body in bodies)
        {
            itm = new data();
            itm.ID = body.name + "_" + body.GetInstanceID();
            itm.Name = body.name;
            itm.levelname = Application.loadedLevelName;
            itm.objectType = body.name.Replace("(Clone)", "");
            itm.posx = body.transform.position.x;
            itm.posy = body.transform.position.y;
            itm.posz = body.transform.position.z;
            itm.tranx = body.transform.rotation.x;
            itm.trany = body.transform.rotation.y;
            itm.tranz = body.transform.rotation.z;
            _GameItems.Add(itm);
			Debug.Log("Transform Y: " + itm.trany.ToString());
        }
        Debug.Log("Items in collection: " + _GameItems.Count);
    }

You are reading the quaternion elements for x,y,z not the euler angles - Quaternions store the rotation using 4 components and none of them are the angles you are looking for.

Instead use

 body.transform.eulerAngles.x

It’s not wrong at all; transform.rotation is a 4D quaternion where the x/y/z/w values range from -1.0 to 1.0. Don’t use it unless you understand quaternions.