Answers for "php date iso 8601 format"

PHP
1

php convert date and time to iso 8601

//Object Oriented Method

$datetime = new DateTime('2010-12-30 23:21:46');

echo $datetime->format(DateTime::ATOM); // Updated ISO8601


//Procedural Method

echo date(DATE_ISO8601, strtotime('2010-12-30 23:21:46'));
Posted by: Guest on April-03-2020
0

php date format iso

echo date(DATE_ISO8601, strtotime('2010-12-30 23:21:46'));
Posted by: Guest on December-16-2020
6

php get day of week

date('w'); //gets day of week as number(0=sunday,1=monday...,6=sat)

//note:returns 0 through 6 but as string so to check if monday do this:
if(date('w') == 1){
	echo "its monday baby";
}
Posted by: Guest on July-19-2019
0

date format with t and z php

str_replace('+00:00', '.000Z', gmdate('c', strtotime('2013-05-07 18:56:57')))
Posted by: Guest on December-14-2020

Browse Popular Code Answers by Language