Timer and time stamps

Hi,

I'm trying to make a project where a led turns on when you press a button for example 1min.
But when you release the button the timer needs to count down.

For example if I press the button for 30 seconds and release it for 10 seconds, I still need to hold it for 40 seconds before the led can come on. ((30-10)+40)=60.

I can't seem to wrap my head around the code to do this, all I know how to use is the millis() function.

Any help is much appriciated!
Thanks in advance.

bert_warlop:
For example if I press the button for 30 seconds and release it for 10 seconds…

How will the code know the 10 second release time has elapsed?

QED

uint32_t nTimerMillis = 0;

void loop()
{
    if ((nTimerMillis == 0) && (digitalRead(nButtonPin) == HIGH))
    {
         nTimerMillis = millis() + 60000/*1 minute in milliseconds*/;
         digitalWrite(nLEDPin, HIGH);
    }
    else if (nTimerMillis >= millis())
    {
          nTimerMillis = 0;
          digitalWrite(nLEDPin, LOW);
    }
}