Happy Hours Specials Basic - problem with time zones
#1
Posted 11 December 2011 - 08:54 AM
I need to know where OsCommerce gets the time and date from generically? I have installed the above contribution and it is not working correctly. Int eh contribution you set a time and date for a special to be active, but I am in New Zealand, but our site is hosted in the US. I made a page for the specials to show on and in that page I put:
date_default_timezone_set( 'Pacific/Auckland' );
The specials show at the right date and time on that page using our local time, but when I add to cart, or click on the product page, (product_info.php) the special price does not show, because the time in the US is 12 hours behind ours. If I set the specials times to 12 hours out then they add to cart with the right price, but then they are out on my new page, because we are 12 hours ahead!
Please help and let me know where it gets the date from, so I can pop in my time zone.
Thanks
Kevin
#2
Posted 11 December 2011 - 01:34 PM
http://www.oscommerce.com/community/contributions,4156
If that doesn't work, you can go to (path to catalog)/includes/languages/english.php and find this line:
@setlocale(LC_TIME, 'en_US.ISO_8859-1');
And consider changing to this:
@setlocale(LC_TIME, 'ge_GE.ISO_8859-1');
See how these things work. Hope it helps.
Simple 1-2-3 Intructions on how to get, install and configure SSL
The Google Sandbox explained
Simple to follow instructions on how to change the look of your OSC
How To Make A Horrible OSC Website
my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor
my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...
#3
Posted 11 December 2011 - 05:57 PM
Try putting date_default_timezone_set( 'Pacific/Auckland' ); in application_top.php, so it kicks in on every page.
This assumes the OP is at PHP 5.1 or higher.
Edited by MrPhil, 11 December 2011 - 05:59 PM.
#4
Posted 11 December 2011 - 06:32 PM
MrPhil, on 11 December 2011 - 05:57 PM, said:
This assumes the OP is at PHP 5.1 or higher.
I actually tried that already and it did not make any difference.
Any other ideas?'
Kev
#5
Posted 11 December 2011 - 08:06 PM
Maybe one of them will suit your location and actually work for you.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#6
Posted 11 December 2011 - 08:47 PM
#7
Posted 11 December 2011 - 08:56 PM
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#8
Posted 11 December 2011 - 10:07 PM
Old code (from the contribution):
$date = date ('Y-m-d');
$time = date ('H:i:s');
New code:
$my_local_time = time() - (12 * 60 * 60); // server time - 12 hours
$date = date ('Y-m-d', $my_local_time );
$time = date ('H:i:s', $my_local_time );
It may not be the ideal solution but it does work (I tested it).
And my sincerest apologies if I've offended anyone by erroneously thinking Aukland was part of Australia.
I haven't had a geography lesson in several decades...
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#9
Posted 12 December 2011 - 01:06 AM
Cheers
Kev
Edited by bigbob2, 12 December 2011 - 01:13 AM.
#10
Posted 12 December 2011 - 01:13 AM
$date = date ('Y-m-d');
$time = date ('H:i:s');
Cheers
Kev
#11
Posted 12 December 2011 - 01:19 AM
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#12
Posted 12 December 2011 - 03:29 PM









