Change time of publication of the news

Results 1 to 7 of 7
  1. #1
    Member UndMe is offline
    MemberRank
    Jul 2014 Join Date
    71Posts

    ! Change time of publication of the news

    Hi, well it turns out that I have a clock with the time server that works perfectly on my website, but when you post a publication in the news section brand me a completely different time.
    Could someone tell me where module could change this?
    I put a photo so you can see the problem.

    hora.png

    thank you very much


  2. #2
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: Change time of publication of the news

    Change time-zone of ur webserver? php.ini + google.

  3. #3
    Member UndMe is offline
    MemberRank
    Jul 2014 Join Date
    71Posts

    Re: Change time of publication of the news

    Not to change the server time, this works perfectly. I mean changing the publication of the news because if the server time puts 15:15 for example, if a notice published at the same time leaves me totally different as 19:19.
    And I want the set to the correct time is that of the server.
    It can be said that when the web is independent of the news and want it to be the same time of publication the time server.

  4. #4
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: Change time of publication of the news

    And what i've said?

    Website display time base on webserver configuration (php.ini)

    unless it's set in some of ur web files like

    PHP Code:
        date_default_timezone_set('Asia/Hong_kong'); 
    Server time (can't tell exactly w/o seeing code) but probably read your local-time.

    You can change webserver time-zone at php.ini
    PHP Code:
    [Date]
    Defines the default timezone used by the date functions
    http://php.net/date.timezone
    date.timezone=Asia/Hong_kong 
    save restart webserver & see if it helps

    If still doesn't help, then check if you have included somewhere

    PHP Code:
        date_default_timezone_set 
    & change to your current time-zone.


    Full list of time-zones (click on continent/region to see list)
    http://php.net/manual/en/timezones.php
    Last edited by 2009x2014; 13-12-14 at 03:47 PM.

  5. #5
    Member UndMe is offline
    MemberRank
    Jul 2014 Join Date
    71Posts

    Re: Change time of publication of the news

    4FUNer appreciate your response but I have a web hosting so I can not edit the php.ini (besides what I just asked and they told me that you can not edit).
    The page if I test locally if it puts me when the news to the same as the server, but do not understand how this getting a good hour and a wrong ...
    It is as if the main time putting While take my computer but the news from elsewhere and still can not figure it out.
    In the template there any section where you can set the time and that this evil place or not?
    The hosting has connection to the database on my computer and is operated on mucore 1.0.8

  6. #6
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: Change time of publication of the news

    If you cannot touch php.ini then

    open template index.php

    At beginning of file after <? or <?php tag

    add

    PHP Code:
        date_default_timezone_set('Asia/Hong_kong'); 
    or if there is no tags at the beginning

    add

    PHP Code:
    <?php date_default_timezone_set('Asia/Hong_kong');  ?>

    Of course Asia/Hong_kong replace with ur time-zone
    like i said earlier you can find there by clicking on your region/continent
    http://php.net/manual/en/timezones.php


    Admin control panel may require the same modification (just visual)

    It will work as long func date is used to retrieve time.

  7. #7
    Member UndMe is offline
    MemberRank
    Jul 2014 Join Date
    71Posts

    Re: Change time of publication of the news

    4FUNer Thank you so much, you helped me a lot with the problem. I just fix now putting php statement you gave me:


    <php date_default_timezone_set ('Asia / Hong_Kong'); ?>


    Editing the time zone of Asia / Hong_Kong for mine.


    Regards, UndMe



Advertisement