1
Feichtl
Get todays date in extcal 2.2.2
  • 2009/9/4 9:06

  • Feichtl

  • Not too shy to talk

  • Posts: 126

  • Since: 2004/11/8


I'm on a fresh installation of XOOPS 2.3.3 and extcal 2.2.2 in a PHP 5.3.0 and MySQL 5 environment.

extcal brings an error in all different views (week-list, month-list, year-list, week-calender, ...). As example the week-list:

Warningdate() [function.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 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/.../modules/extcal/week.php on line 18

Warning: date() [function.date]: It is not safe to rely on the system'
s timezone settingsYou are *requiredto 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 warningyou most likely misspelled the timezone identifierWe selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/.../modules/extcal/week.php on line 19

Warning
date() [function.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 'Europe/Berlin' for 'CEST/2.0/DST' instead in /home/.../modules/extcal/week.php on line 20


If i change lines 18-19 in week php from
$year = isset($_GET['year']) ? intval($_GET['year']) : date('Y');
$month = isset($_GET['month']) ? intval($_GET['month']) : date('n');
$day = isset($_GET['day']) ? intval($_GET['day']) : date('j');


to
$year = isset($_GET['year']) ? intval($_GET['year']) : date_default_timezone_set('Y');
$month = isset($_GET['month']) ? intval($_GET['month']) : date_default_timezone_set('n');
$day = isset($_GET['day']) ? intval($_GET['day']) : date_default_timezone_set('j');


the error is gone, BUT i don't get todays date! Calender view starts in the year 1999!

What's going wrong here?

2
Feichtl
Re: Get todays date in extcal 2.2.2
  • 2009/9/4 17:39

  • Feichtl

  • Not too shy to talk

  • Posts: 126

  • Since: 2004/11/8


I played around a bit and changed back to PHP 5.1.10 for the moment. But for further compatibility to upcoming PHP versions this should be fixed.

3
riorma
Re: Get todays date in extcal 2.2.2
  • 2009/12/18 13:28

  • riorma

  • Just popping in

  • Posts: 1

  • Since: 2009/12/18


Hi!

I'm installing 2.2.2. on XOOPS 2.3.3., with PHP 5.3.0, and I'm having the same problem.

I have just add date_default_timezone_set instead of date, and the calendar starts at 1999...

How could I fix it without changing PHP version?

Thanks a lot, and my apologies by my english and programming skills...


Thanks in advance!

4
ghia
Re: Get todays date in extcal 2.2.2
  • 2009/12/18 14:29

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


The use of date_default_timezone_set is wrong.
Undo these changes.

In stead try by editing mainfile.php and add
date_default_timezone_set('Europe/Brussels');

Choose the name of your time zone from here.

When a user is logged on, it could be advantagous to set the default timezone in relation to the timezone selected in his profile.

5
Feichtl
Re: Get todays date in extcal 2.2.2
  • 2010/3/10 13:22

  • Feichtl

  • Not too shy to talk

  • Posts: 126

  • Since: 2004/11/8


I read this late, but this is a very helpful hint! THX a lot!

Login

Who's Online

313 user(s) are online (225 user(s) are browsing Support Forums)


Members: 0


Guests: 313


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits