Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:19:35+00:00 2026-06-17T17:19:35+00:00

I have wierd issues with time / date in PHP this year. Code have

  • 0

I have wierd issues with time / date in PHP this year. Code have not changed at all and my dates are bugged.

Code is for example:

$date = strtotime($order['date']);

$dateNew = date('Y-m-d h:i A', $date);

print $dateNew;

Returns 1969-12-31 07:00 PM for some reasson, altough:

print $order['date'];

Returns 2013-01-12 18:25:43

I’m confused because I’m quite sure that my code is correct.

I dare you to solve this bugger!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:19:36+00:00Added an answer on June 17, 2026 at 5:19 pm

    The function strtotime() was made for transform English into date format.

    The function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC), relative to the timestamp given in now, or the current time if now is not supplied.

    As i don’t know what is really into your $order variable i will suggest 2 solutions :

    Maybe you can avoid the strtotime function and replace it by date() directly like this :

    $order = ['date' => '2013-01-12 18:25:43'];
    $date = date($order['date']);
    

    It works well here: http://codepad.viper-7.com/cbNA87

    Or, if it’s not working consider to use mktime(), it will convert the date into seconds since the epoch.

    The Unix epoch is the reference point for all time stamps. PHP calculates the times from this date in seconds.
    The $date should be null and your server in the east coast of the US so it’s returns the epoch 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code which works out the time from today until a given
I have a wierd hibernate related issue while setting a date field in an
I have a few weird issues I need to solve. First, let me show
I am currently following this tutorial . Until now, I have met so many
Hey there, I have an issues/bug when trying to have a v3 and v2
I am debugging a C code where I have a pointer inside a pointer
update: After not getting anywhere with this, I noticed that when I pulled the
I'm having some issues with a jQuery AJAX call. My code works fine when
I would expect Time and to_time to be reflective. UPDATE This is the answer,
I've spent a lot of time troubleshooting this myself but none of what I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.