The day about which you do not know whether it is 30th sha'ban or 1st Ramadan is
called doubtful day "Yaumul Shak". On this day it is haram to fast with the
intention of 1st Ramadan and a fast with this niyyat is invalid.
It is not wajib to fast on this day. However, it is mustahab to keep fast on
this day but the intention (niyyat) should be either
(a) with the Niyyat of Mafiz-zimma (to discharge my responsibility), (although
such a niyat is allowed, it is better to avoid it)
(b) with the Niyyat of any Qaza fast of previous Ramadan, if any, or
(c) with the Niyyat of Mustahab Sha'ban fast.
If you are fasting on Yaumul shak, and if, at any time on that day, you get the
news of moon sighting of Ramadan, then you must immediately change Niyyat to
that of 1st of Ramadan.
If you have fasted on Yaumul shak (with any valid Niyyat), and afterwards (after
the day is over) you come to know that it was 1st of Ramadan, then your fast
will automatically be counted as fast of 1st of Ramadan.
If you are not fasting on yaumul shak, then following actions are necessary on
(a) If you get the news after sunset of yaumul shak that the moon had been
actually sighted on evening of 29th sha'ban, then you have to keep Qaza of 1st
Ramadan after the month of Ramadan.
(b) If you get the news of moon sighting after Zawal time (Islamic mid-day),
then it is haram to do anything which breaks a fast from that time until Iftar
time on that day, and you have to do Qaza of 1st of Ramadan later on.
(c) If you get the news of moon sighting before Zawal time (Islamic mid-day),
(i) if you have not or done anything which breaks fast, you must immediately do
the Niyyat of fasting of Ramadan for that day.
(ii) if you have done anything which breaks fast, then you have to do imsaak
(refrain from anything that breaks fast) for the remainder of the day, and then
do Qaza of 1st of Ramadan later on.