How to create element with absolute position

I want Date to appear above Second section. plz guide how to achieve it

    var sectionTwo = document.getElementById("sectionTwo");
    var x = sectionTwo.getBoundingClientRect();
    var b = document.createElement("div");
    b.style.position = 'fixed';
    b.innerHTML = new Date();
    document.body.appendChild(b);
    b.style.top = (x.top - b.style.height) + 'px';