Problems, need help? Have a tip or advice? Post it here.
13 posts Page 2 of 2
I am replying to my earlier post. The locale as explained there works for date conversion to another language than English. However, the locale is still not working for me for time.

Today, I wanted to show a 'last updated on date time' notification under posts. So I inserted the following tag in the code:
Code: Select all
<cms:date k_page_modification_date format='H:i' locale='nl_NL' />

In my config.php the locale is set as follows:
Code: Select all
define( 'K_GMT_OFFSET', +1 );

This should be correct as I am in the Europe/Amsterdam time zone with is UTC+1.

However, when I change the post at 13:30 then it shows under the post as 12:30.
For now, I solved it by changing K_GMT_OFFSET to +2. But that is incorrect. I am not in the Europe/Berlin time zone. London really is only 1 hour behind us.
How is this possible, and how can this be solved?
"I have never tried that before, so I think I should definitely be able to do that" - Pippi Longstocking
@brightwolf, I think the discrepancy is due to Daylight Saving Time (DST).
Perhaps the following would help -
viewtopic.php?f=8&t=8098
Hi KK, that was my initial thought as well. And yes, we're in daylight saving now, but the time difference between London and Amsterdam still is one hour, not two. Anyway, I followed the link you supplied and the solution provided there works like a charm! Thanks for helping out once more.

This is what I have added to my config.php:

Code: Select all
   date_default_timezone_set( 'Europe/Amsterdam' );
   define( 'K_GMT_OFFSET', date('Z')/3600 );
"I have never tried that before, so I think I should definitely be able to do that" - Pippi Longstocking
13 posts Page 2 of 2
cron