Title: Undefined variable: time_difference &amp; Undefined offset
Last modified: August 21, 2016

---

# Undefined variable: time_difference & Undefined offset

 *  Resolved [dhphoto_se](https://wordpress.org/support/users/dhphoto_se/)
 * (@dhphoto_se)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-time_difference-undefined-offset/)
 * I get an error with Similarity. I haven’t noticed it Before, so I suspect it 
   came with the latest WordPress update, 3.8.1
 * You can find it on one of my posts, for example [http://www.dhphoto.se/2014/01/arvid-6-dagar/](http://www.dhphoto.se/2014/01/arvid-6-dagar/)
 * The error shows at the bottom as
 * _Notice: Undefined variable: time\_difference in /storage/content/32/103332/dhphoto.
   se/public\_html/wp-content/plugins/similarity/similarity.php on line 325 Notice:
   Undefined offset: 0 in /storage/content/32/103332/dhphoto.se/public\_html/wp-
   content/plugins/similarity/similarity.php on line 337_
 * **Do you have any suggestions of how to deal with this?**
 * I tried to replace “$time_difference” with “get_option( ‘gmt_offset’ )”.
    After
   this change the first error was gone but the second “Undefined offset: 0” was
   still there. **Any suggestions?**
 * Kind regards,
    Dennis Hallgren dhphoto, Sweden
 * [http://wordpress.org/plugins/similarity/](http://wordpress.org/plugins/similarity/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [dhphoto_se](https://wordpress.org/support/users/dhphoto_se/)
 * (@dhphoto_se)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-time_difference-undefined-offset/#post-4538487)
 * Hi again!
 * I solved it! 😀
 * I exchanged “$time_difference” with “get_option(‘gmt_offset’)” on line 325.
    
   Then I deleted “[0]” in the “$id_list” and “$strength_list” a few rows below.
 * Works lika a charm, and haven’t seen any bugs.

Viewing 1 replies (of 1 total)

The topic ‘Undefined variable: time_difference & Undefined offset’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/similarity.svg)
 * [Similarity](https://wordpress.org/plugins/similarity/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/similarity/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/similarity/)
 * [Active Topics](https://wordpress.org/support/plugin/similarity/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/similarity/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/similarity/reviews/)

## Tags

 * [undefined offset](https://wordpress.org/support/topic-tag/undefined-offset/)
 * [undefined variable](https://wordpress.org/support/topic-tag/undefined-variable/)

 * 1 reply
 * 1 participant
 * Last reply from: [dhphoto_se](https://wordpress.org/support/users/dhphoto_se/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-time_difference-undefined-offset/#post-4538487)
 * Status: resolved