Title: get the local date
Last modified: March 25, 2018

---

# get the local date

 *  [erisal](https://wordpress.org/support/users/erisal/)
 * (@erisal)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/)
 * Hi,
    I’m looking for a way to get the local date/time in the hook traitment. 
   The one provided by the “payment_date” variable does not correspond to the local
   date/time. I would like the same one that appears in the back-end entries. Is
   it possible ?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [angelleye](https://wordpress.org/support/users/angelleye/)
 * (@angelleye)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/#post-10114034)
 * The payment date provided by PayPal IPN is GMT, so you could run that value through
   PHP’s `date()` function to reformat it however you want.
 *  Thread Starter [erisal](https://wordpress.org/support/users/erisal/)
 * (@erisal)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/#post-10114203)
 * Thank you for your reply.
    I’m not interested by the date in the PayPal frame
   but by the one you store in the database entry. This one interests me because
   it’s already formatted and corresponds to my time zone.
 *  Plugin Contributor [angelleye](https://wordpress.org/support/users/angelleye/)
 * (@angelleye)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/#post-10126548)
 * Sorry for the delayed response. What field in the database specifically are you
   referring to?
 *  Thread Starter [erisal](https://wordpress.org/support/users/erisal/)
 * (@erisal)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/#post-10126658)
 * I used the instruction “$now = current_time(‘mysql’);” to get the date/time but
   several times, the server of the hoster had a problem of synchronization and 
   I obtained an erroneous information. I looked for the best way to get the date/
   time and I’m now using:
    $tz = new DateTimeZone(‘Europe/Paris’); $nowObj = new
   DateTime(null, $tz); $now = $nowObj->format(‘Y/m/d H:i:s’); Everything is fine
   now. Your plugin works perfectly well and it is very useful to me. Thank you 
   very much.
    -  This reply was modified 8 years, 4 months ago by [erisal](https://wordpress.org/support/users/erisal/).
    -  This reply was modified 8 years, 4 months ago by [erisal](https://wordpress.org/support/users/erisal/).
 *  [angelleyesupport](https://wordpress.org/support/users/angelleyesupport/)
 * (@angelleyesupport)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/#post-10136972)
 * Glad that you have figured that our and I’m sorry for delay in getting back to
   you.
    Let me know if you need any further assistance. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘get the local date’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paypal-ipn_b2a7a0.svg)
 * [PayPal IPN for WordPress](https://wordpress.org/plugins/paypal-ipn/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paypal-ipn/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paypal-ipn/)
 * [Active Topics](https://wordpress.org/support/plugin/paypal-ipn/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paypal-ipn/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paypal-ipn/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [angelleyesupport](https://wordpress.org/support/users/angelleyesupport/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/get-the-local-date/#post-10136972)
 * Status: not resolved