1. Easy fix date and time error

Easy fix date and time error

  |   8
Easy fix date and time error

Sometimes it's very annoying security message show up and can give you pull out of your hair because don't know what sent wrong or what the hell is going on...and most of the time you will get warning message like
Message:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead
So what should you do for easy fix and make the message gone? the answer is very simple...in my case I use this code to add to index.php simply add it before the line
define ( 'DATALIFEENGINE', true );
in your site root index.php
Information!You must register before you can view this text. Please register or Login
if you look at the code it doesn't give much information and it doesn't really change your server time zone but it will just get your time zone converted to GMT instead of server default setting, so it;s quite simple...I am sure if you have good way to handle it then you can share with us which will help other users out...
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+10

Comments 8

bartas
bartas
Members
Commented By bartas on May 30, 2014 (2:20 pm)
Not working for me ;/
N/A 1Forum topics : 2Forum replies : 3Forum likes : 0
DLEStarter
DLEStarter
DLE TEAM
Commented By DLEStarter on May 30, 2014 (5:22 pm)
if it doesn't work then you can specify it manually by add this line before
define ( 'DATALIFEENGINE', true );

Add
date_default_timezone_set('America/Denver'); 
Just change America/Denver to whatever your time zone is. you can get the correct and full list of time zone here: https://php.net/manual/en/timezones.php
29 225Forum topics : 9Forum replies : 558Forum likes : 116
mika
mika
Members
Commented By mika on June 16, 2014 (7:11 am)
The file : \ engine \ modules \ addcomments.php
Find:
            // update the number of comments on the news 
            if( $where_approve ) $db->query( "UPDATE " . PREFIX . "_post SET comm_num=comm_num+1 WHERE id='{$post_id}'" );


Replace with:

            // update the number of comments in news  
            $added_time = time() + ($config['date_adjust'] * 60);
            $thistime = date( "Y-m-d H:i:s", $added_time );

            if( $where_approve ) $db->query( "UPDATE " . PREFIX . "_post SET comm_num=comm_num+1, date='{$thistime}' WHERE id='{$post_id}'" );


Version DLE: 9.x-10.x
Source: dle-faq.ru
5 4Forum topics : 0Forum replies : 0Forum likes : 0
Kathryn
Kathryn
V.I.P.
Commented By Kathryn on August 31, 2014 (11:46 pm)
My site calendar is off by a day. I find it hard to find the hours by the negative and positive control you even it out since I have no idea what timezone it is based from.. I added the line on the index page as stated above but it did not change anything for some reason. Does anyone know how to fix that?
15 47Forum topics : 109Forum replies : 481Forum likes : 6
DLEStarter
DLEStarter
DLE TEAM
Commented By DLEStarter on September 1, 2014 (1:37 am)
as far I can tell, your site is hosting under 50Webs.com, in their server you are allowed to modify php.ini...simply change it in your control panel in 50webs.com cp, change it to your local time, I think the default 50webs is set to America/New York, when we hosted dlestarter.com with them we changed it to America/Denver.

more importantly, 50webs server never has this kind of error so you don\t need this hack on your site, just change php.ini in advanced mode and set in DLE admin CP to set time zone to "0" this will match to your server local time after changed php.ini
29 225Forum topics : 9Forum replies : 558Forum likes : 116
Kathryn
Kathryn
V.I.P.
Commented By Kathryn on September 1, 2014 (11:25 am)
Quote: DLEStarter
as far I can tell, your site is hosting under 50Webs.com, in their server you are allowed to modify php.ini...simply change it in your control panel in 50webs.com cp, change it to your local time, I think the default 50webs is set to America/New York, when we hosted dlestarter.com with them we changed it to America/Denver.

more importantly, 50webs server never has this kind of error so you don\t need this hack on your site, just change php.ini in advanced mode and set in DLE admin CP to set time zone to "0" this will match to your server local time after changed php.ini


Last night I stayed up till midnight, and reset everything including the index.php and when I tested it this morning just now.. It is exact. But I had to still set the difference for the host to -420. That is nuts huh
15 47Forum topics : 109Forum replies : 481Forum likes : 6
yorismith
yorismith
Moderators
Commented By yorismith on September 5, 2014 (7:31 pm)
-420? I don't there are 420 hours per day unless your server set the date to 10 years ago...which will be very funny...the value of date is 0 to 12 and -1 to -12...think about time zone, how many hours different between your time and server? your local time is 420 hours behind your server? what's furiously funny...all you need is set php.ini in advanced setting in 50webs cp to change America/New York to America/Los Angeles and set DLE to "0" then you will have server time as LA time...and that exactly what dlestarter.com used when they were with 50webs.
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
onchannel
onchannel
V.I.P.
Commented By onchannel on October 4, 2015 (5:59 am)
Quote: yorismith
-420? I don't there are 420 hours per day unless your server set the date to 10 years ago...which will be very funny...the value of date is 0 to 12 and -1 to -12...think about time zone, how many hours different between your time and server? your local time is 420 hours behind your server? what's furiously funny...all you need is set php.ini in advanced setting in 50webs cp to change America/New York to America/Los Angeles and set DLE to "0" then you will have server time as LA time...and that exactly what dlestarter.com used when they were with 50webs.


i have the same issues with my 10.3 version. if I am adding new articles, before publishing them to the main i have to select all of them, use the "CURENT DATE" option and after that publish them in the main.

if i`m adding the news without the "CURRENT DATE" option first, the articles are not showing on the /lastnews/ page , only if i search them in the search bar.

please help me with this issue.

thank you in advance
N/A 84Forum topics : 8Forum replies : 14Forum likes : 0

full movies
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.