Basic Rotations over "X" amount of time.

I attempting to get these rotations, on button press, to happen over on second, and they will be happening multiple times per game. I cant seem to get it right. In quite new to C# so bear with me.

using UnityEngine;
using System.Collections;

public class MoveAll : MonoBehaviour 
{

	void Start () 
	{
	
	}
	void Update () 
	{

		if (Input.GetKeyDown (KeyCode.D)) 
		{
			this.transform.Rotate (Vector3.up * 30);
		}

		if (Input.GetKeyDown (KeyCode.A)) 
		{
			this.transform.Rotate (Vector3.down * 30);
		}
	
	}
}

If I understand you correctly, you want to pres a button once and then have the object rotate for 1 second? You’d have to set a ‘rotating’ boolean when you press a button, then rotate the object while that is true and set it to false when you want the rotation to stop.
Something like,

public class MoveAll : MonoBehaviour {

   bool clockwiseRotation = false;
   bool counterclockwiseRotation = false;
   float rotationStartTime; 

   void Update(){

     if(Input.GetKeyDown(KeyCode.D)) {
       counterclockwiseRotation = false;
       clockwiseRotation = true;
       rotationStartTime = Time.time;
     }
     if(Input.GetKeyDown(KeyCode.A)) {
       counterclockwiseRotation = true;
       clockwiseRotation = false;
       rotationStartTime = Time.time;
     }

     if(clockwiseRotation && Time.time - rotationStartTime < 1.0F){
       this.transform.Rotate(Vector3.up * 30 * Time.deltaTime);
     } else clockwiseRotation = false;

     if(counterclockwiseRotation && Time.time - rotationStartTime < 1.0F){
       this.transform.Rotate(Vector3.down * 30 * Time.deltaTime);
     } else counterclockwiseRotation = false;

   }
}

I have no idea if what I’m calling clockwise and counterclockwise here are actually that but you should get the idea.