At what moment does the Shabbat actually end? I have been taught that the Shabbat begins when the candles are lit so one should let the match burn out and not extinguish it. Does it therefore end when the havdalah candle is lit or when the candle is extiguished. If it is the latter, how is it then permitted to light the havdalah candle during Shabbat?
One is allowed to light the havdala candle because it is permissible to do those labors that are forbidden on shabbat (=39 m’lachot) once (a)shabbat is over according to the hour listed on the calendar and (b)the person doing the labor has said either “atta chonantanu” as part of the evening prayer or “baruch hamavdil bein kodesh l’chol” (Shulchan Aruch 299,10).