Time array problem

Home Forums Quform WordPress Time array problem

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20119
    jerkski
    Participant

    Hello, I have a time field in h:i A format. I am trying to access it via session variable, but for some reason I can’t. Here is my code. Can you see the problem?

    $upTime=$_SESSION[‘iphorm_2’][‘iphorm_2_18’]; //Timestamp
    $upTime = isset($upTime[‘hour’], $upTime[‘minute’], $upTime[‘ampm’]) ? date(‘h:i A’, strtotime(“{$upTime[‘hour’]}:{$upTime[‘minute’]}:{$upTime[‘ampm’]}”)) : ”;

    I can see the array object via var_dump:

    [“iphorm_2_18”]=> array(3) { [“hour”]=> string(2) “10” [“minute”]=> string(2) “36” [“ampm”]=> string(2) “pm” }

    #20120
    jerkski
    Participant

    Hello, hoping this is a simple fix. I can do the same with isset for date, but for some reason doing the same procedure for time results in the value of my variable being 12:00 am no matter what time is actually in $_SESSION[‘iphorm_2’][‘iphorm_2_18’]

    Any ideas?

    #20144
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #20145
    jerkski
    Participant

    I will try it out. Thank you!

    #20190
    jerkski
    Participant

    Resolved! Thank you Ally! Figured it was something easy…

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy