Jump to content

Recommended Posts

I have this error to resolve to be compatible with PHP 5.3:

 

Parse error: syntax error, unexpected '.', expecting '(' in/includes/counter.php on line 27

 

Code Line 27 is:    $counter_startdate_formatted = strftime(DATE_FORMAT_LONG, function.mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4)));

 

Appreciate any help!

Thanks!

I removed the function. and now this warning appeared:

 

Warning: mktime() [function.mktime]: 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 'EST/-5.0/no DST' instead in /includes/counter.php on line 27

yip, that will happen if you don't have the default time zone set in the php.ini file.  Yuocan set it during runtime using the date_default_timezone_set('country/area'); function at the top of your page.  See here for a list of timezones to use -> http://www.php.net/manual/en/timezones.php

Thanks!

I removed the function. and now this warning appeared:

 

Warning: mktime() [function.mktime]: 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 'EST/-5.0/no DST' instead in /includes/counter.php on line 27

I need to put in Canada/Eastern

What is the code and do I put it in the php.ini file?

There's not much in this file. It only states:  register_globals = On

That's all that's in the code.

 

depends, do you want the change to affect every page or just one?

just one: use the php function in the error, else use the php.ini directive.

I need to put in Canada/Eastern

What is the code and do I put it in the php.ini file?

There's not much in this file. It only states:  register_globals = On

That's all that's in the code.

 

If you care to look at the manual, you will see at the bottom of the "others" page, the one with Canada/Eastern on it.  There is a warning.

Warning

 

Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons.

I'm sorry! I'm fairly new to PHP and don't know what your talking about. I must seem like a dummy.

 

This is the code I put in the only php.ini file I could find and the code file is right up near the top.

 

register_globals = On

 

// US TimeZones according to DateTime's official  "List of Supported Timezones"

$aTimeZones = array(

  'America/New_York'=>'EDT',

);

?>

 

It did not remove the error:

Warning: strftime() [function.strftime]: 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 'EST/-5.0/no DST' instead in /includes/modules/new_products.php on line 16

 

If you can help please tell me if that is right code and where am I to place it? Or what is the right code?

 

I did read that You can set a default time zone for your server from the configuration file (php.ini) at the line:

 

[Date]

; Defines the default timezone used by the date functions

date.timezone = America/New_York

 

I could not find a line that started with [Date]

 

 

it's the first line in modue settings on mine:

;;;;;;;;;;;;;;;;;;;

; Module Settings ;

;;;;;;;;;;;;;;;;;;;

 

[Date]

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

date.timezone = Europe/London

 

if it is not in the modue settings of your php.ini file you could try adding it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.