Title: timestamp problem
Last modified: August 24, 2016

---

# timestamp problem

 *  Resolved [Kai Niermann](https://wordpress.org/support/users/joloshop/)
 * (@joloshop)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/timestamp-problem/)
 * Hi I have a code which shows me the expire date of a taxonomy post
 *     ```
       <?php $expire_date = clpr_get_expire_date($pid,'raw');
   
       				if ( appthemes_days_between_dates( $expire_date ) > 0 ) {
       					$time = clpr_get_expire_date($pid, 'time' );
       					$time_left = human_time_diff( $time + ( 24*3600 ), current_time( 'timestamp' ) );
   
       					$expires_text = sprintf( __( 'Läuft in %s ab', APP_TD ), $time_left );
       				} else {
       					$expires_text = __( 'Nur noch heute gültig', APP_TD );
       				} ?><?php echo $expires_text  ?>
       ```
   
 * It works great however if there is no date set it also shows
 *     ```
       else {
       					$expires_text = __( 'Nur noch heute gültig', APP_TD );
       ```
   
 * however I would like to show another text in this case how do i accomplish this?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Kai Niermann](https://wordpress.org/support/users/joloshop/)
 * (@joloshop)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/timestamp-problem/#post-5998414)
 * Okay answer my own question did some playing and this works
 *     ```
       <?php $expire_date = clpr_get_expire_date($pid,'raw');
   
       				if ( appthemes_days_between_dates( $expire_date ) > 0 ) {
       					$time = clpr_get_expire_date($pid, 'time' );
       					$time_left = human_time_diff( $time + ( 24*3600 ), current_time( 'timestamp' ) );
   
       					$expires_text = sprintf( __( 'Läuft in %s ab', APP_TD ), $time_left );
       				 }
       				elseif (appthemes_days_between_dates( $expire_date ) > -1 ) {
       					$time = clpr_get_expire_date($pid, 'time' );
       					$time_left = human_time_diff( $time + ( 24*3600 ), current_time( 'timestamp' ) );
   
       					$expires_text = sprintf( __( 'Nur noch heute gültig', APP_TD ), $time_left );
   
       				} else {
       					$expires_text = __( 'Bis auf Wiederruf', APP_TD );
       				} ?><?php echo $expires_text  ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘timestamp problem’ is closed to new replies.

## Tags

 * [expired](https://wordpress.org/support/topic-tag/expired/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [timestamp](https://wordpress.org/support/topic-tag/timestamp/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [Kai Niermann](https://wordpress.org/support/users/joloshop/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/timestamp-problem/#post-5998414)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
