• 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

    (@angelleye)

    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

    (@erisal)

    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

    (@angelleye)

    Sorry for the delayed response. What field in the database specifically are you referring to?

    Thread Starter erisal

    (@erisal)

    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 6 years, 11 months ago by erisal.
    • This reply was modified 6 years, 11 months ago by erisal.

    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.