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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:31:01+00:00 2026-06-15T07:31:01+00:00

I have a question that is making me crazy, My Task is to parse

  • 0

I have a question that is making me crazy,
My Task is to parse a date from an API and transform it to RFC 822 format, because the feed that is coming out gets an validation error

the date from the API looks like this :

<review created="2012-10-23 14:51:12.0">

I have one Date in the description made via substr

$xtime = substr($review["created"], 0, 16);
$jahr = substr($xtime,0,4);
$mon  = substr($xtime,5,2);
$tag  = substr($xtime,8,2);
$datneu = $tag.'.'.$mon.'.'.$jahr; 

this date will be rendered like :

23.10.2012

For the pubdate I made

$xtime = substr($review["created"], 0, 16);
$xxl = $pubtime . " GMT";

rendered like :

2012-10-23 14:51:12 GMT

And W3C feed validator says it´s not validate because pubDate is not in RFC 822 form

Sorry

This feed does not validate.

line 10, column 38: pubDate must be an RFC-822 date-time: 2012-10-29 11:51:23 GMT (5 occurrences) [help]

          <pubDate>2012-10-29 11:51:23 GMT</pubDate>

and it needs to look like :

<pubDate>Wed, 02 Oct 2002 13:00:00 GMT</pubDate>

i can imagine a hacky solution for expressing sth like “if (month = 01){ actualmonth = Jan}” but i really don´t know how to do same with the days,

Also i´m not too comfortable with PHP but I need to solve this asap.

Hope you can help me, there must be a solution i didnt found at similiar questions

regards John

  • 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-15T07:31:03+00:00Added an answer on June 15, 2026 at 7:31 am

    Have a look at DateTime::createFromFormat() or date_create_from_format.

    https://www.php.net/manual/en/datetime.createfromformat.php

    <?php
    $date = date_create_from_format('Y-m-d H:i:s', '2012-10-23 14:51:12.0');
    echo date_format($date, 'D, d M Y H:i:s');
    ?>
    

    Have a look at the possible date formats

    https://www.php.net/manual/en/function.date.php

    EDIT: fixed

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

Sidebar

Related Questions

I have a question about a If-statement that is really making me crazy. It
I have a question about making static libraries that use other static libraries. I
I have a question that's been bugging me all afternoon: I'm making a guitar
I just have a little question about a query making me crazy. I'm working
I have a question that should be quick and easy for you guys to
I have a question that may be quite naive, but I feel the need
I have a question that I just don't feel like I've found a satisfactory
I have a question that I'm ashamed to ask, but I'm going to have
I have a question that may sound odd, but being somewhat of a newbie,
I have a question that can I use AS400ConnectionPool in Spring if then pls

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.