Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

date and time post on website

  • 25-11-2011 1:06pm
    #1
    Registered Users Posts: 306 ✭✭


    Hi,

    I am looking to display the date and time underneath new text I add on a website.
    For example Fri, 25/11/2011 - 22:15 underneath Heading 1 that I add. If I update the website by adding new text to Heading 1 an hour later I want it to display Fri, 25/11/2011 - 23:15.
    I am looking to apply this for other headings on the same page.

    Does anyone know how I can do this? I can pm the website link if need be and am doing this for a favour. If anyone can help please would appreciate it.


Comments

  • Registered Users Posts: 8,070 ✭✭✭Placebo




  • Registered Users Posts: 10,455 ✭✭✭✭28064212


    What are you using to update the website?

    Boardsie Enhancement Suite - a browser extension to make using Boards on desktop a better experience (includes full-width display, keyboard shortcuts, and dark mode). Now available through the extension stores

    Firefox: https://addons.mozilla.org/addon/boardsie-enhancement-suite/

    Chrome/Edge/Opera: https://chromewebstore.google.com/detail/boardsie-enhancement-suit/bbgnmnfagihoohjkofdnofcfmkpdmmce



  • Registered Users Posts: 306 ✭✭leinster93


    Hi, thanks for the replies. I'm using dw cs5. After trawling the website I think I have the answer. This seems to do what I need to display...

    <h4>Posted
    <script type="text/javascript">
    <!--
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    document.write(month + "/" + day + "/" + year)
    //-->
    </script>
    </h4>

    If I make an update to any part of the website though I think the date and time will also update which will display the wrong update date...I haven't tested this yet but assume will be the case.


  • Registered Users Posts: 10,455 ✭✭✭✭28064212


    leinster93 wrote: »
    Hi, thanks for the replies. I'm using dw cs5. After trawling the website I think I have the answer. This seems to do what I need to display...

    <h4>Posted
    <script type="text/javascript">
    <!--
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    document.write(month + "/" + day + "/" + year)
    //-->
    </script>
    </h4>

    If I make an update to any part of the website though I think the date and time will also update which will display the wrong update date...I haven't tested this yet but assume will be the case.
    That will display the current time for anybody visiting the page, it has nothing to do with when it was updated. You have to do this on the server-side, not the client-side. TBH, the easiest way to do it is manually. Any other solution is going to be a lot of work

    Boardsie Enhancement Suite - a browser extension to make using Boards on desktop a better experience (includes full-width display, keyboard shortcuts, and dark mode). Now available through the extension stores

    Firefox: https://addons.mozilla.org/addon/boardsie-enhancement-suite/

    Chrome/Edge/Opera: https://chromewebstore.google.com/detail/boardsie-enhancement-suit/bbgnmnfagihoohjkofdnofcfmkpdmmce



  • Registered Users Posts: 306 ✭✭leinster93


    Ok, thanks.


  • Advertisement
Advertisement