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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:41:39+00:00 2026-05-26T00:41:39+00:00

Possible Duplicate: Convert one date format into another in PHP I have a date

  • 0

Possible Duplicate:
Convert one date format into another in PHP

I have a date in the following format DD, d MM, yy (Friday, 21 October, 2011) how do I reformat it to store in mySQL db in the date format (0000-00-00)?

  • 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-05-26T00:41:40+00:00Added an answer on May 26, 2026 at 12:41 am

    Use the date function:

    $time = strtotime("Friday, 21 October, 2011");
    echo date("Y-m-d", $time);
    

    The linked page provides a good description of the available format specifiers,
    and you can see the predefined datetime constants here.


    Format           Description
    ================================================================================
    d                Day of the month, 2 digits with leading zeros
    D                A textual representation of a day, three letters
    j                Day of the month without leading zeros
    l                A full textual representation of the day of the week
    N                ISO-8601 numeric representation of the day of the week
    S                English ordinal suffix for the day of the month, 2 characters
    w                Numeric representation of the day of the week
    z                The day of the year (starting from 0)
    Week             ---------------------------------------------------------------
    W                ISO-8601 week number of year, weeks starting on Monday
    Month            ---------------------------------------------------------------
    F                A full textual representation of a month, such as January or March
    m                Numeric representation of a month, with leading zeros
    M                A short textual representation of a month, three letters
    n                Numeric representation of a month, without leading zeros
    t                Number of days in the given month
    Year             ---------------------------------------------------------------
    L                Whether it's a leap year
    o                ISO-8601 year number.
    Y                A full numeric representation of a year, 4 digits
    y                A two digit representation of a year
    Time             ---------------------------------------------------------------
    a                Lowercase Ante meridiem and Post meridiem
    A                Uppercase Ante meridiem and Post meridiem
    B                Swatch Internet time
    g                12-hour format of an hour without leading zeros
    G                24-hour format of an hour without leading zeros
    h                12-hour format of an hour with leading zeros
    H                24-hour format of an hour with leading zeros
    i                Minutes with leading zeros
    s                Seconds, with leading zeros
    u                Microseconds (added in PHP 5.2.2)
    Timezone         ---------------------------------------------------------------
    e                Timezone identifier (added in PHP 5.1.0)
    I                Whether or not the date is in daylight saving time
    O                Difference to Greenwich time (GMT) in hours
    P                Difference to Greenwich time (GMT) with colon between h and m
    T                Timezone abbreviation
    Z                Timezone offset in seconds.
    Full Date/Time   ---------------------------------------------------------------
    c                ISO 8601 date (added in PHP 5)
    r                » RFC 2822 formatted date
    U                Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: PHP convert one date into another date format 2011-09-06 needs to be
Possible Duplicate: PHP convert one date into another date format This is PHP I
Possible Duplicate: Converting date From one format to another I have a date, for
Possible Duplicate: Counting the swaps required to convert one permutation into another I'm looking
Possible Duplicate: how to convert java string to Date object I have a form
Possible Duplicate: Split string, convert ToList<int>() in one line… i have a string that
Possible Duplicate: How can I convert ereg expressions to preg in PHP? I need
Possible Duplicate: C# Cannot convert from IEnumerable<Base> to IEnumerable<Derived> I have D1 and D2
Possible Duplicate: Compiling a java program into an exe Hi, I'd like to convert
Possible Duplicate: Convert HTML + CSS to PDF with PHP? Please give code for

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.