Which is the middle prayer?
Question

                Which is the begining of the day- is it fajr or magrib. Please tell me. Which is the middle prayer. If it is asr then, fajr is the beginning of the day. Please clarify me in detail from the quran and the hadeeth.
Praise be to Allah.
    Identifying the middle prayer which is mentioned in the verse 
    (interpretation of the meaning): “Guard strictly (five obligatory) 
    As‑Salawaat (the prayers) especially the middle Salaah (i.e. the best 
    prayer). And stand before Allaah with obedience [and do not speak to others 
    during the Salaah (prayers)]” [al-Baqarah 2:238] is one of the matters 
    concerning which there is a difference of opinion among the scholars, and 
    concerning which there are approximately 20 opinions, as listed by al-Haafiz 
    Ibn Hajar (may Allah have mercy on him) in Fath al-Baari (8/197). 
    Al-Haafiz ‘Abd al-Mu’min al-Dimyaati (may Allah have mercy on him) wrote a 
    book concerning that entitled Kashf al-Mughatta fi Tabyeen al-Salaat 
    al-Wusta. The strongest of these opinions are two: 

    1.That it is Fajr prayer

    This is the view of Abu Umaamah, Anas, Jaabir, 
    Abu’l-‘Aaliyah, ‘Ubaydah ibn ‘Umayr, ‘Ata’, ‘Ikrimah, Mujaahid and others, 
    and it is one of the two views of Ibn ‘Umar and Ibn ‘Abbaas. 

    It is also the view of Maalik and of al-Shaafa’i as stated in
    al-Umm. End quote from Fath al-Baari (8/196). 

    2.That it is ‘Asr prayer

    This is the view of most of the scholars, and it is the 
    correct and reliable view, because of the evidence to that effect in the 
    Qur’aan and the Sunnah. 

    This is the view of 'Ali ibn Abi Taalib. Al-Tirmidhi and 
    al-Nasaa’i narrated that Zurr ibn Hubaysh said: We said to ‘Ubaydah: Ask 
    ‘Ali about the middle prayer. He asked him and he said: We used to think 
    that that was Fajr, until I heard the Messenger of Allah (blessings and 
    peace of Allah be upon him) say on the day of al-Ahzaab: “They distracted us 
    from the middle prayer, ‘Asr prayer.” This report states that it is ‘Asr in 
    the words of the Prophet (blessings and peace of Allah be upon him). The 
    argument for it being Fajr is strong, but the correct view is that it is 
    ‘Asr. 

    This is the view of Ibn Mas’ood and Abu Hurayrah, and it is 
    the correct view according to the madhhab of Abu Haneefah; it is also the 
    view of Ahmad and the view which most of the Shaafa’is adopted because of 
    the soundness of the hadeeth. 

    Al-Tirmidhi said: It is the view of most of the scholars 
    among the Sahaabah. 

    Al-Mawardi said: This is the view of the majority of the 
    Taabi’een. 

    Ibn ‘Abd al-Barr said: It is the view of most of scholars of 
    hadeeth. 

    Among the Maalikis, this is the view of Ibn Habeeb, Ibn 
    al-‘Arabi and Ibn ‘Atiyyah. End quote from Fath al-Baari, 8/196. 

    Al-Nawawi (may Allah have mercy on him) said: 

    What is indicated by the saheeh hadeeths is that it is ‘Asr, 
    and this is the favoured view. End quote. 

    Al-Majmoo’, 3/61 

    Al-Haafiz al-Dimyaati mentioned some of the particular 
    virtues that are unique to ‘Asr prayer: 

    ·The Messenger of Allah 
    (blessings and peace of Allah be upon him) emphasised the calamity of 
    missing it and described it as loss of family and wealth, when he said: 
    “Whoever misses ‘Asr prayer, it is as if he has lost his family and his 
    wealth.”

    ·The good deeds of the one who 
    misses it are lost.

    ·It was dearer to them than 
    their own selves and their parents, children, families and wealth.

    ·It was the first prayer at the 
    time of which the fear prayer was prescribed.

    ·It was the first prayer in 
    which the Prophet (blessings and peace of Allah be upon him) turned to face 
    the Ka’bah.

    ·The Prophet (blessings and 
    peace of Allah be upon him) said: “A man tries to sell an item after ‘Asr by 
    swearing an oath by Allah…”. So Allaah showed the seriousness of an oath 
    sworn after ‘Asr prayer.

    ·Sulaymaan (blessings and peace 
    of Allah be upon him) destroyed a large number of horses because inspecting 
    them distracted him from ‘Asr prayer until the sun set.

    ·Allaah says (interpretation of 
    the meaning): “By Al‑‘Asr (the time). 2. Verily, 
    man is in loss…” [al-‘Asr 103:1-2]

    ·It was the middle prayer to be 
    made obligatory, because the first prayer to be made obligatory was Fajr and 
    the last was ‘Isha’, so it was the middle prayer in being made obligatory.

    End quote. Kashf al-Mughta, p. 126-132 

    With regard to the question about the beginning of the day, 
    and whether it is during the night or the day, the answer is that the night 
    comes before the day. So when the sun sets, the night belonging to the 
    following day has begun. Hence when the new moon of Ramadan is sighted, the 
    people pray Taraweeh that night because that night is part of Ramadan, and 
    when they see the new moon of Eid, they do not pray Taraweeh because that is 
    part of Shawwaal. 

    But that does not imply that Fajr is the middle prayer, 
    because what is meant by middle here is the best, not the one that is in the 
    middle between two things. 

    See: al-Tahreer wa’l-Tanweer, 15/253; Tafseer 
    Soorat al-Baqarah by Ibn ‘Uthaymeen, 2/178. 

    And Allaah knows best.