Page 1 of 1
Expiration Date: is that AM or PM

Posted:
November 7th, 2011, 12:02 pm
by bluej
Hi
I want to use a coupon code with an expiration date
Example:
XMAS|5.00|12/31/2021|ra-only
Would that expire at midnight 12/31/2021, as in 12PM
Or
Would it expire at the beginning of 12/31/2021, as in 12AM
??
thanks for your reply
Re: Expiration Date: is that AM or PM

Posted:
November 8th, 2011, 1:29 am
by Cristián Lávaque
Hmm... Good question! I've never wondered, so I didn't ask.

One way to tell would be creating a coupon that expires today and see if it lets you use it until 12PM or if it expired.
Re: Expiration Date: is that AM or PM

Posted:
November 8th, 2011, 8:31 am
by bluej
Hmm... Would the answer be the same if I said I was asking about the $129 pro version I purchased? Just curious...
Re: Expiration Date: is that AM or PM

Posted:
November 8th, 2011, 10:03 am
by bluej
OK I did the test you suggested.
All signs are that the expiration is 12AM on the date you specify. So in my case, since I want a coupon to be good till midnight on a certain day, it works to set the expiration for the next day.
Hope this helps others too.
Re: Expiration Date: is that AM or PM

Posted:
November 8th, 2011, 10:24 am
by Eduan
Okay thanks!
Will be useful to know!
Re: Expiration Date: is that AM or PM

Posted:
November 10th, 2011, 11:55 pm
by Cristián Lávaque
Great. Thanks for the update bluej.

Re: Expiration Date: is that AM or PM

Posted:
November 11th, 2011, 7:52 am
by bluej
Maybe add it to the documentation? Just a suggestion. Thanks for the great plugin.
Re: Expiration Date: is that AM or PM

Posted:
November 12th, 2011, 2:20 am
by Cristián Lávaque
Yeah, it's a good suggestion. I already emailed Jason. Thanks for the suggestion and the kudos!

Re: Expiration Date: is that AM or PM

Posted:
November 15th, 2011, 12:15 pm
by Jason Caldwell
Thanks for the heads up on this thread.All of WordPress, and all of s2Member, operates on UTC Universal Time. So, a Coupon Code set to expire on 12/31/2021, would no longer be valid on Jan 1st 2022 at exactly 12:00 am UTC.
See:
http://en.wikipedia.org/wiki/Coordinated_Universal_Time
Re: Expiration Date: is that AM or PM

Posted:
November 15th, 2011, 12:28 pm
by bluej
That's correct -- so that is why I changed my local version of WordPress to use Pacific Standard time as the client wanted.
Don't you just love that about WordPress?
Re: Expiration Date: is that AM or PM

Posted:
November 15th, 2011, 12:36 pm
by Jason Caldwell
Thanks for the follow-up.
Yes, that's a nice feature that WordPress makes possible, so that dates/times can be "displayed" in something other than UTC, or for a site owners that want to see publish dates/times in their own time zone. However, this feature for WordPress, only affects the "display" of dates/times.
Unless you've made more substantial changes, it does not affect the way WordPress or s2Member stores and compares dates/times. In the case of CRON jobs and/or internal date comparisons, those are calculated with UTC. Thus, changing the display of dates/times within WordPress will not change the expiration date/time of a Coupon Code. It's always based on UTC time.
Re: Expiration Date: is that AM or PM

Posted:
November 16th, 2011, 8:26 am
by bluej
So to clarify
I am referring to the Timezone setting feature of WordPress, not date formatting.
You can set a timezone according to a city.
Say I set my timezone to Los Angeles and Wordpress tells me the UTC is 2011-11-16 13:25:19
Are you saying that s2Member Pro ignores this?
Thank you this is important for client work.
Re: Expiration Date: is that AM or PM

Posted:
November 16th, 2011, 10:37 am
by Jason Caldwell
Thanks for the follow-up.
Yes, that is correct. Actually, it's not really s2Member that ignores the time, that's just how WordPress works internally. Your /wp-settings.php file takes part in loading the WordPress core, and this file will ALWAYS force PHP to use the UTC timezone, regardless of what you configure in the Dashboard. That configuration in the Dashboard is mostly for the benefit of the site owner, so you can see UTC dates/times in your own timezone ( i.e. so publish dates make sense to you ).
When I first started working with WordPress, I questioned the way this was handled. However, as I have worked with WordPress over the years, I've seen why this decision was made. When you're dealing with a web site, you're dealing with visitors from all over the world. Setting a timezone to something that's US-based, or even to your own personal timezone, is really not helping all of your visitors, because each of them may be in a different location in the US, or even in a different part of the world.
Universal time is a good way to standardize times for a web site. It allows internal date/time calculations to remain accurate, regardless of the timezone on a particular server, or in a specific area of the world. In addition, it's easy to convert a UTC time into a localized display, based on a city or region.
The important thing to remember, is that your site may display times to you and your visitors based on the local timezone that you've configured. However, all dates/times within WordPress are stored as UTC. Any data/time comparisons and/or expirations within WordPress will always be based on UTC.