PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Expiration Date: is that AM or PM

s2Member Plugin. A Membership plugin for WordPress®.

Expiration Date: is that AM or PM

Postby bluej » November 7th, 2011, 12:02 pm

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
User avatar
bluej
Registered User
Registered User
 
Posts: 19
Joined: August 3, 2011

Re: Expiration Date: is that AM or PM

Postby Cristián Lávaque » November 8th, 2011, 1:29 am

Hmm... Good question! I've never wondered, so I didn't ask. :P

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.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Expiration Date: is that AM or PM

Postby bluej » November 8th, 2011, 8:31 am

Hmm... Would the answer be the same if I said I was asking about the $129 pro version I purchased? Just curious...
User avatar
bluej
Registered User
Registered User
 
Posts: 19
Joined: August 3, 2011

Re: Expiration Date: is that AM or PM

Postby bluej » November 8th, 2011, 10:03 am

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.
User avatar
bluej
Registered User
Registered User
 
Posts: 19
Joined: August 3, 2011

Re: Expiration Date: is that AM or PM

Postby Eduan » November 8th, 2011, 10:24 am

Okay thanks!
Will be useful to know!
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Expiration Date: is that AM or PM

Postby Cristián Lávaque » November 10th, 2011, 11:55 pm

Great. Thanks for the update bluej. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Expiration Date: is that AM or PM

Postby bluej » November 11th, 2011, 7:52 am

Maybe add it to the documentation? Just a suggestion. Thanks for the great plugin.
User avatar
bluej
Registered User
Registered User
 
Posts: 19
Joined: August 3, 2011

Re: Expiration Date: is that AM or PM

Postby Cristián Lávaque » November 12th, 2011, 2:20 am

Yeah, it's a good suggestion. I already emailed Jason. Thanks for the suggestion and the kudos! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Expiration Date: is that AM or PM

Postby Jason Caldwell » November 15th, 2011, 12:15 pm

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
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Expiration Date: is that AM or PM

Postby bluej » November 15th, 2011, 12:28 pm

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?
User avatar
bluej
Registered User
Registered User
 
Posts: 19
Joined: August 3, 2011

Re: Expiration Date: is that AM or PM

Postby Jason Caldwell » November 15th, 2011, 12:36 pm

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Expiration Date: is that AM or PM

Postby bluej » November 16th, 2011, 8:26 am

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.
User avatar
bluej
Registered User
Registered User
 
Posts: 19
Joined: August 3, 2011

Re: Expiration Date: is that AM or PM

Postby Jason Caldwell » November 16th, 2011, 10:37 am

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests

cron