Date and time on comments

  • Unknown's avatar

    Hi all, when users post a comment, the date and time of the comment are the ones of the site, which is true for anybody watching from the same time zone, but wrong all over the rest of the world. Some could be told that the comment had been posted in the future.
    Any solution to show the local time ?
    Thank you.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi Patrick,

    am afraid there are no ready-to-use plugins for this task, so the only thing I suppose is to hire a developer to complete that task for you.
    Probably it could be a relative time calculation, to show something like “posted 1 hour ago”.

    A good place to start is checking info here: https://wordpress.com/support/working-with-a-developer/. However this link does not provide any resources to find a developer, so you can choose whoever you like/already know :)

  • Unknown's avatar

    Hi Maskimurasov,
    Thank you for taking the time of your answer. I am afraid there is no solution so far as well.
    But it is kind of frustrating because it sounds so easy to get this done : instead of memorizing the local time of the site on each post or comment, UTC time should be memorized and then local time should be displayed according to the time zone of the IP address.
    Thanks for the link, this is very useful.

  • Unknown's avatar

    Patrick,

    you are right. As far as I know, wordpress already saves the timestamp on server in UTC and then adds a difference that is saved in your wp admin page. This way, a correct static time is shown on blog.
    The problem could be solved with some JavaScript, to amend the time showed to customer based on his browsers time settings.

    By the way, do you have BUSINESS or ECOMMERCE plans to be able to install plugins? If yes, then probably this will help:
    “Blog Time” plugin. It has an option to place a widget in footer, then You can name it like “The current time zone of this blog: ” and it shows your current time, not the visitors, then visitor can understand why blog post time is in future.
    Does it help?

  • Unknown's avatar

    Thank you Maksimurasov, yes this is the best we could do. But you know how people are : they are going to keep asking why they have posted “in 2 hours”..

  • Unknown's avatar

    By the way, I have mentioned relative time (like “one hour ago”), there are plugins for that too, I believe you can find one that is most suitable:

    Meks Time Ago https://wordpress.org/plugins/meks-time-ago/#description
    WP Relative Date (by default works on comments only, but can be extended to posts by using some custom code) https://en-gb.wordpress.org/plugins/wp-relativedate/

  • The topic ‘Date and time on comments’ is closed to new replies.