ndjustin20 Posted April 18, 2008 Share Posted April 18, 2008 Greetings! I was wondering if someone would either know or might be able to point me in the right direction. I have scoured the internet, and this site, and can't seem to find any examples of setting the time for an inventoried item against the time of the storefront. Here is my problem: I currently can set a storefront to have a time based on where the storefront is located which is cross referenced by time zones ie. eastern, central, ect. What I would like to do now is do the same thing with my inventory so say I have a bicycle listed and want it only to be available for purchase from 12 noon until 3pm so it will start to be shown at 12 noon and stop being shown at 3pm. How would I achieve this by referencing the storefront time and not the server time as this wouldn't accurately reflect the storefront time ie. plus or minus server time depending on time zone loacation? Any recommendations at all are greatly appreciated. Justin Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 18, 2008 Share Posted April 18, 2008 It might make more sense to set the server inventory based on GMT so you do not need to care where your server is located (or moved). Then pass a GMT offset with the 12noon and 3pm that varies with the store time zone to use in server queries. Quote Link to comment Share on other sites More sharing options...
ndjustin20 Posted April 18, 2008 Author Share Posted April 18, 2008 I'll give that a try....so by doing so I would use the off set instead of plus or minus the central time zone....guess I didn't think of that....so I wouldn't be creating an item referencing the storefront time though instead reference the GMT and use that to create the time for the item ie start and stop times....that seems like it would work....No more double post'in for me....wasn't sure which area to post in...sorry! Quote Link to comment Share on other sites More sharing options...
fenway Posted April 18, 2008 Share Posted April 18, 2008 MySQL has convienient functions for both (a) switch any date/time to a given timezone and (b) setting the timezone for the current connection, in which case it's all handled for you. Quote Link to comment Share on other sites More sharing options...
ndjustin20 Posted April 18, 2008 Author Share Posted April 18, 2008 So do those functions compare the server time or GMT though because I am running into serious problems using server time comparisons. Quote Link to comment Share on other sites More sharing options...
fenway Posted April 19, 2008 Share Posted April 19, 2008 So do those functions compare the server time or GMT though because I am running into serious problems using server time comparisons. They are stored in time-zone-independent format (call it GMT)... but only if you stored them properly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.