• Resolved Eric Mallek

    (@eric-mallek)


    Hello out there –
    I am using 3.5.1 with a modified (child) theme of Sliding Door. I’m currently adding code into the footer.php file with a date/time stamp. (working on a local host/MAMP before uploading changes etc…)

    Heres my code
    <?php

    echo date_default_timezone_set(‘America/Los_Angeles’) ;
    echo date(‘F j g:i a’) ;

    ?>

    its returning – 1April 20 7:36 pm

    I can not seem to find out where that extra 1 digit before the month is coming in. I have removed the time zone and it then the digit comes up at the end of the line (after pm)

    Has anyone else experienced this? Its probably an easy fix…. Thanks!

    Eric

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

    (@jgwpk)

    You do not need to echo date_default_timezone_set('America/Los_Angeles')

    Thread Starter Eric Mallek

    (@eric-mallek)

    Yup! That was it. Looks like its back in UTC but ill fix that… I figured it would be easy…Thanks!

    Justin

    (@jgwpk)

    No Problem.

    Justin

    (@jgwpk)

    One thing. You said the time zone changed back. do you still have the timezone set function there or did you rid it completely.

    Just use

    date_default_timezone_set('America/Los_Angeles') ;

    Without the echo

    Thread Starter Eric Mallek

    (@eric-mallek)

    yup, took out echo is exactly what I did… Thanks again!

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

The topic ‘Weird coding output. Have you seen this?’ is closed to new replies.