Using millis() or delay function to control motor

Im using the basic sweep sketch to have a servo motor sweep from 0 degrees to 30 and back with a 10ms delay for each sweep.

I want to use the millis() or delay() funtion in order to have the the servo sweep for only the first 10 minutes of every hour.
It doesnt have to be perfect on the milisecond, but I want it to at least function within a specific time frame.
Ive never used either the millis() or delay() function, so Im confused as to where to integrate either of them with the rest of the code or how to work with them.

code:
// Sweep
// This example code is in the public domain.

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{
for(pos = 0; pos < 30; pos += 1) // goes from 0 degrees to 30 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 15ms for the servo to reach the position
}
for(pos = 30; pos>=1; pos-=1) // goes from 30 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 15ms for the servo to reach the position
}
}

I want to use the millis() or delay() funtion in order to have the the servo sweep for only the first 10 minutes of every hour.

The delay() function simply causes nothing to happen, for the specified amount of time, whenever it is called. It would be up to you to call it for 50 minutes, at 10 after, each hour.

The millis() function returns the number of milliseconds since the Arduino was reset. While is does a good job of tracking elapsed time, there is no way to know exactly what time it is. It's like using a stopwatch in place of a regular watch.

Great for elapsed times, but what time is it now?

For making things happen at specific times, you need a real time clock (RTC) - an external piece of hardware - or access to some other device that knows the actual time - a PC or other computer that knows the time.