@Scott White
wow, that’s the first time I’ve seen such issue.
Let’s try to solve it:
– What is the timezone in WP Settings?
Timezone is currently set to “Vancouver”, which is PST.
The server time is currently set to “America/Vancouver”. Same timezone.
That’s why I’m not sure why it would have such a discrepancy… the wordpress time actually matches the server exactly (both located in the same timezone). I’m at a loss.
@Scott White
Just to confirm – this the default ai1ec 1.2.2 version.
You haven’t edited or changed the plugin’s source in anyway, right?
All that I have changed is the css file (colours)
Great, we will have to try a few cases before knowing what is going on:
1. Can you upload the contents of app/view/week.php file from your server to wordpress.pastebin.com and give it to me?
2. Can you upload a test.php file to the root of your wordpress and run it in your browser. The contents of test.php are:
<?php
require( 'wp-load.php' );
echo esc_html( date_i18n( get_option( 'time_format', 'g a' ), gmmktime( 0, 0 ) ) );
?>
Let me know the output.
Thanks!
The output of test.php is:
4:00 pm
Pastbin link is: http://pastebin.com/SKPk8t3F
Okay, can you change the test.php file’s contents to this:
<?php
require( 'wp-load.php' );
echo esc_html( date_i18n( 'g a', gmmktime( 0, 0 ) ) );
?>
and let me know the output
Doh!
What’s the output of this:
<?php
echo gmdate( "M d Y H:i:s", gmmktime( 0, 0 ) );
?>
and what is your PHP version?
PHP 5.3.8 (cli) (built: Dec 30 2011 10:35:28)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
with the ionCube PHP Loader v4.0.9, Copyright (c) 2002-2011, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Jan 10 2012 00:00:35 is the new output (sorry, didn’t see you post that, only saw the php version request)
ah great, we are getting somewhere π
Time for a new test, put the following content in test.php and let me know the output:
http://pastebin.com/5LcTMvHA
date_i18n( ‘g a’ ): 4 pm
without esc_html: 4 pm
date_i18n with gmt set: 12 am
F j, Y g:i a : January 9, 2012 4:00 pm
There it is!
Edit: app/view/week.php
Line: 93
From: <div><?php echo esc_html( date_i18n( $time_format, gmmktime( $hour, 0 ) ) ) ?></div>
To: <div><?php echo esc_html( date_i18n( $time_format, gmmktime( $hour, 0 ), true ) ) ?></div>
Let me know if it solves it for you.