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 8692249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:16:51+00:00 2026-06-13T00:16:51+00:00

I have an input field for ‘birthday’ I’m using a javascript popup that returns

  • 0

I have an input field for ‘birthday’ I’m using a javascript popup that returns the date in the following format “MM-DD’YYYY”, when I bring echo the value in the input field in my insert code, it displays properly, but when I use

$c_birthday = $_POST['dateBorn'];
$birth=date('Y.m.d',strtotime($c_birthday));

If I echo $c_birthday, it displays the value correctly such as “10-02-2012” but when I echo $birth, it shows 2012-02-10, it’s transposing the day and the month, I’ve tried using ‘Y-m-d’ and I get the same results.

Is there a setting I should be looking at?

  • 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-13T00:16:52+00:00Added an answer on June 13, 2026 at 12:16 am

    FROM PHP DOC

    Note:

    Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.

    To avoid potential ambiguity, it’s best to use ISO 8601 (YYYY-MM-DD) dates or DateTime::createFromFormat() when possible.

    To avoid potential ambiguity as stated you can just use :

    $dt = DateTime::createFromFormat("m-d-Y", $c_birthday);
    $dt->format("Y.m.d");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a input field and on clicking that I will show a date
Possible Duplicate: PHP/MySQL - Format date/time I have input field (name:day1 and varchar) to
I have an input field that autocompletes using text taken from a PHP page.
I have an input field that is by default set to type=text so that
I have an input field that uses Autocomplete to show a list of possible
i have an input field which will be displayed. i want that to hide
I have an input field with an id that is used as a button.
I have an input field on a webpage that contains a credit-card number. What
I have an input field that is rendered with a template like so: <div
I have an input field like the following: <input class=... maxlength=... title=... size=... value=...

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.