Ramadan is a lunar month so its start and end are confirmed by the sighting of the new moon. It requires two acceptable Muslims testifying to the fact, but if no one sees it; Muslims must complete the precedent month.
What is more important than fasting is forming the intention. Muslims are obliged to form the intention and it must be formed before dawn. If the fasting is voluntary it is acceptable to form it during the day.