Getting timestamp of activation plugin time

You’ll have to use get- and add_option inside a register_activation_hook. <?php register_activation_hook(__FILE__,’save_activation_timestamp’); function save_activation_timestamp() { add_option(“myplugin_activation_timestamp”,mktime()); } ?> You can find an entire tutorial on that at CodeYoghurt. It even mentions your case as an example.

About Time conditionals

Here is how it works for me with minor changes: global $post; $post_created = strtotime($post->post_date); $sixMonthsAgo = strtotime(‘-6 months’); $human_time=”hace “. human_time_diff( get_the_time(‘U’), current_time(‘timestamp’) ); $mobile = wp_is_mobile(); if ($post_created > $sixMonthsAgo && $mobile) { the_time(‘j. M .Y’); } elseif( $post_created > $sixMonthsAgo && !$mobile) { the_time(‘j. F .Y’); } else { echo $human_time; } … Read more

display month in french in wordpress/php?

there is a custom function in wordpress called date_i18n. so basically you do echo date_i18n( ‘H:i d-m-Y’, $ts ); without the setLocale stuff.. find the function date_i18n and its parameters here. you could even build in your translation all in there, without the language check before: date_i18n( __( ‘H:i d-m-Y’, ‘textdomain’ ) ); (replace ‘textdomain’ … Read more

Customize Time Stamp

In this updated version of meks_time_ago(), the human readable date/time will be returned if the published date was less than the $threshold of days ago. Otherwise, the full date and dime will be returned. function meks_time_ago( $days_threshold = 3 ) { $published_date_timestamp = get_the_time( ‘U’ ); $current_date = new DateTime(); $published_date = new DateTime( “@$published_date_timestamp” … Read more

Swatch Internet Time for article timestamps

You can use ‘B’ as the format for the_date() and/or the_time() to generate Swatch Internet Time format. If you’re modifying a theme, just find the references to the_date() and/or the_time() in the template files and change the value of the format parameter. If you’re creating a plugin, you can hook into the get_the_date and/or get_the_time … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)