Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RFC-822 DateTime Formatting in PHP with Database [duplicate]

Tags:

date

php

I have a date field on my database. the date format as following.

June 17, 2013

Im using the format as

date("F j, Y");

So my question is there a way that i can display this date in RFC-822 format using php? or do i need to start saving the date in RFC-822 format from now on? Thanks in advance.

like image 622
maxlk Avatar asked Feb 06 '26 14:02

maxlk


1 Answers

Using the following syntax, you can display current time in RFC822 Format.

$date = new DateTime('2000-01-01');
echo $date->format(DateTime::RFC822);
like image 125
DevZer0 Avatar answered Feb 09 '26 08:02

DevZer0