- This topic has 10 replies, 6 voices, and was last updated 11 years, 8 months ago by .
Viewing 11 posts - 1 through 11 (of 11 total)
Viewing 11 posts - 1 through 11 (of 11 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › WP Member – Time format of member expiry date
I have to change the date format (timestamp) in my login widget in that way: d.m.Y.
What file must I modify?
Search for the following line of code from the “wp_eMember1.php” file and change it to whatever you like:
$sub_expires = date('F j, Y',strtotime("+" . $auth->my_subscription_duration . " days ", $sub_start));
Fine, thank you.
Changed it to j. F Y. But even I have set German language there are the English words for the month (e.g. July instead of Juli). Cannot find a hint in the language file.
The date value comes directly from your server’s PHP engine. When using the date function you might be able to specify the language that you want PHP to use in order to output the date value.
Did you change something? I can’t find the string
$sub_expires = date(‘F j, Y’,strtotime(“+” . $auth->my_subscription_duration . ” days “, $sub_start));
in wp_eMember1.php (eMember 7.0.4).
Yeah we moved some code around to make them more modular. On newer build of eMember you will find that line in the following file:
eMember_auth_utils.php
Cool, thank you!
For other Europeans who don’t know much about php (like me) this could be another solution:
$sub_expires = date(‘d.m.y’,strtotime(“+” . $auth->my_subscription_duration . ” days “, $sub_start));
“d.m.y” will show the following date format: 17.12.2011
Please correct me if I am wrong.
Have a good time
David
I am trying to change the date format in the login widget, too. (Instead of: Your Account Expires: 15-03-2013 it should be Your Account Expires: 15. 03. 2013)
I don’t find the described code in eMember_auth_utils.php. Has the procedure changed? Or is there an easier way now?
Ideally, we like to use the same date format that you have set in the General settings of your WordPress installation. However, we have run into a little issue with non-english installation of WordPress.
For the time being, you can modify the following function in the “eMember_misc_functions.php” file to change the date format:
function emember_date_locale
Modify this function to return the date value in any format you like.