How to add a timestamp to the exported WXR filename?

I don’t think you need to do that, it’s already there (if I understand the question correctly): In the WXR file we get a timestamp like: that’s generated with: <?php the_generator( ‘export’ ); ?> that calls get_the_generator() where the export case is: $gen = ‘<!– generator=”WordPress/’ . get_bloginfo_rss(‘version’) . ‘” created=”‘. date(‘Y-m-d H:i’) . ‘” … Read more

How to get Unix Local Time?

Please use DateTime::getTimestamp() that returns unix timestamp. If you want to format the date according to your time zone then you try this. $datetime = new DateTime(“now”, new DateTimeZone(‘America/New York’)); echo $datetime ->format(‘m/d/Y, H:i:s’);

Count time from registration date to today

Just gave an example of how to do it: $today_date = new DateTime( date( ‘Y-m-d’, strtotime( ‘today’ ) ) ); $register_date = get_the_author_meta( ‘user_registered’, get_current_user_id() ); $registered = new DateTime( date( ‘Y-m-d’, strtotime( $register_date ) ) ); $interval_date = $today_date->diff( $registered ); if( $interval_date->days < 31 ) { echo ‘With us ‘ . $interval_date->format(‘%d days’); … Read more

strtotime not working

The current_time() function whenever passed a timestamp as a parameter will return a UNIX Timestamp which is already been run through strtotime(). By passing that variable to strtotime() you’re trying to timestamp a timestamp. Try this instead: $tomorrow_time = date( ‘Y-m-j’, $time_now );