Title: Published Time
Last modified: June 9, 2017

---

# Published Time

 *  Resolved [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [9 years ago](https://wordpress.org/support/topic/published-time/)
 * Hi 🙂
 * I have an issue with published time. I want to be sure that the issue is related
   to your plugin or not.
 * Because My site is in Persian, so my readers are in Iran and we use different
   calendar called Shamsi.
 * So Iranian users install a plugin named “wp parsidate” to convert every Gregorian
   date to Shamsi. (So dates convert to shamsi which shown to readers)
 * Ok, so now if you see the source of this link, you can see these parameters:
 * [https://www.ajibtarin.com/one-pic/31091](https://www.ajibtarin.com/one-pic/31091)
 * Yoast Plugin:
    <meta property=”article:published_time” content=”2017-06-07T17:
   57:45+04:30″/>
 * Schema App Plugin:
    “datePublished”:”1396-03-17″ “dateModified”:”2017-06-07″
 * Rating Stars Plugin:
    “datePublished”: “2017-06-07T17:57:45+00:00” “dateModified”:“
   2017-06-07T17:57:45+00:00”
 * Ok so the problem is, schema app detects Shamsi date for published date and that
   gives me an error in structured tools.
 * How is that possible, rating stars plugin detects Gregorian for published date
   but you detect Shamsi one? Is this something that should be fixed on your side?
 * Thanks for your time and support 🙂

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/published-time/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/published-time/page/2/?output_format=md)

 *  Plugin Author [vberkel](https://wordpress.org/support/users/vberkel/)
 * (@vberkel)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/published-time/#post-9222173)
 * Hi Amir,
 * I just want to acknowledge that we’re checking it this week.
 * Regards,
    Mark
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/published-time/#post-9233603)
 * Hi 🙂
 * Did you find any time to check it? 🙂
 *  Plugin Author [vberkel](https://wordpress.org/support/users/vberkel/)
 * (@vberkel)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/published-time/#post-9234267)
 * Yes we installed this plugin [https://wordpress.org/plugins/wp-parsidate/](https://wordpress.org/plugins/wp-parsidate/)
   on local and one of my other staging site and the schema markup dates​ are displaying
   in correct format. The function used in our plugin get_the_date is the correct
   function to output Post published date so there is no issue there.
 * The user either has another date plugin installed or some other plugin is filtering
   the date.
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/published-time/#post-9236597)
 * Thanks. I did 4 tests and I am sure right now the problem is related to your 
   plugin.
 * Test one: Disable all plugins
    In this case dates are ok in google (Because in
   posts dates are also Gregorian)
 * Test Two: Only enabled your plugin
    Same as above
 * Test Tree: Enabled your plugin and parsidate
    In posts date are shamsi. In this
   case your plugin detect shamsi date for published time instead of Gregorian date(
   your plugin correctly shows Gregorian date for modified time)
 * Test four: Enabled everything except your plugin
    In posts, dates are correctly
   in Shamsi format and in google they are Gregorian and everything is ok
 * From these 4 tests I concluded that the problem is your plugin which can not 
   fetch the correct gregorian format for published date
 * About the test you had done, maybe you didn’t enable this option to change the
   dates?
 * > [View post on imgur.com](https://imgur.com/4wIcJaw)
 *  Plugin Author [vberkel](https://wordpress.org/support/users/vberkel/)
 * (@vberkel)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/published-time/#post-9249020)
 * HI Amir,
 * Let me explain why it’s happening to our plugin:
 * [https://plugins.trac.wordpress.org/browser/wp-parsidate/trunk/includes/fixe…](https://plugins.trac.wordpress.org/browser/wp-parsidate/trunk/includes/fixe…)
   line 19 is the hook and line 120 is the callback function.
 * In the code the wpp_fix_i18n function is specifically excluding the callback 
   calls to WPSEO, WC and get_the_modified_date. We use get_the_modified_date for
   the dateModified but for datePublished the WP Function is get_the_date() which
   is not excluded. As far as I can tell, the parsidate plugin should be updated
   to include that function or modified to include Schema App Plugin.
 * Thank you.
    Mark
 *  Plugin Author [vberkel](https://wordpress.org/support/users/vberkel/)
 * (@vberkel)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/published-time/#post-9249191)
 * HI Amir,
 * Let me explain why it’s happening, here is the relevant code in wp-parsidate:
 * [https://plugins.trac.wordpress.org/browser/wp-parsidate/trunk/includes/fixe…](https://plugins.trac.wordpress.org/browser/wp-parsidate/trunk/includes/fixe…)
   line 19 is the hook and line 120 is the callback function.
 * In the code the wpp_fix_i18n function is specifically excluding the callback 
   calls to WPSEO, WC and get_the_modified_date. We use get_the_modified_date for
   the dateModified but for datePublished the WP Function is get_the_date() which
   is not excluded. As far as I can tell, the parsidate plugin should be updated
   to include that function or modified to include Schema App Plugin.
 * Thank you.
    Mark
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/published-time/#post-9398033)
 * Hi again [@vberkel](https://wordpress.org/support/users/vberkel/). Sorry for 
   a huge delay in my response. I wanted to thank you when I fix this problem and
   report you the result, but unfortunately I couldn’t solve it.
 * Do you have any idea what should I add to the fixes-date.php file to fix this
   problem?
 * I really appreciate your time 🙂
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/published-time/#post-9427460)
 * Hi [@vberkel](https://wordpress.org/support/users/vberkel/) 🙂
    You remember 
   about this issue? Finally my developer could fix this by changing your code:
 * > [View post on imgur.com](https://imgur.com/ZhIYM3P)
 * Now datepublished is in Gregorian format. Is this something that you can fix 
   on your side? Because I need to implement it in each plugin update.
 *  Plugin Author [vberkel](https://wordpress.org/support/users/vberkel/)
 * (@vberkel)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/published-time/#post-9438875)
 * Hi Amir,
 * I think the correct way to do this is to add the following on line 134:
 *     ```
       if ( isset( $callers[6]['function'] ) && $callers[6]['function'] == 'get_the_date' ) {
            return $format_string;
       }
       ```
   
 * [https://plugins.trac.wordpress.org/browser/wp-parsidate/trunk/includes/fixes-dates.php](https://plugins.trac.wordpress.org/browser/wp-parsidate/trunk/includes/fixes-dates.php)
 * I think the best way is to make that one change in WP-Parsidate. Otherwise, you
   will need to change the code of every plugin (not just Schema App) and theme 
   that uses the built-in WordPress function. What do you think?
 * Regards,
    Mark
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/published-time/#post-9439865)
 * Hey thank you so much Mark for your help 🙂
 * Unfortunately the code you provided didn’t work.
 * “you will need to change the code of every plugin”
    For now I only edited your
   plugin and did the trick for me 🙂
 * > [View post on imgur.com](https://imgur.com/ZhIYM3P)
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/published-time/#post-9670048)
 * Hi 🙂
    An update for this thread. My developer fixed this problem by editing 
   this file: schema-app-structured-data-for-schemaorg/lib/HunchSchema/page
 * > [View post on imgur.com](https://imgur.com/Sn7mMvT)
 * Is it possible for you to add this to your plugin?
 * Thanks
 *  Plugin Author [vberkel](https://wordpress.org/support/users/vberkel/)
 * (@vberkel)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/published-time/#post-9713972)
 * Ok, I’ve included this code change in today’s release. Thank you for the suggestion.
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/published-time/#post-9714301)
 * Perfect man, thank you so much <3
 *  [Selva](https://wordpress.org/support/users/selvamsubramanyam/)
 * (@selvamsubramanyam)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/published-time/#post-9719262)
 * Hi,
    Date of published showing wrong date. datePublished 1970-01-01.
 * In page.php I have modified
 * ‘datePublished’ => date(‘Y-m-d’, strtotime( **$post-post_date **) )
 * to
 * ‘datePublished’ => date(‘Y-m-d’, strtotime( **$post->post_date** ) )
 *  Thread Starter [Amir](https://wordpress.org/support/users/repenter/)
 * (@repenter)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/published-time/#post-9719270)
 * Yeah [@vberkel](https://wordpress.org/support/users/vberkel/), actually this 
   was the original code that my developer used.
    ( $post->post_date ) )
 * Thanks

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/published-time/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/published-time/page/2/?output_format=md)

The topic ‘Published Time’ is closed to new replies.

 * ![](https://ps.w.org/schema-app-structured-data-for-schemaorg/assets/icon-128x128.
   png?rev=2377223)
 * [Schema App Structured Data](https://wordpress.org/plugins/schema-app-structured-data-for-schemaorg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/schema-app-structured-data-for-schemaorg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/schema-app-structured-data-for-schemaorg/)
 * [Active Topics](https://wordpress.org/support/plugin/schema-app-structured-data-for-schemaorg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/schema-app-structured-data-for-schemaorg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/schema-app-structured-data-for-schemaorg/reviews/)

 * 18 replies
 * 3 participants
 * Last reply from: [Amir](https://wordpress.org/support/users/repenter/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/published-time/page/2/#post-9726162)
 * Status: resolved