2

I'm trying to do this timestamp in php 2019-02-01T08:21:33+0000.

date("Y-m-d") 

What do i need to add to the function date in order to create this timestamp.

Qirel
  • 25,449
  • 7
  • 45
  • 62
Sagy C
  • 37
  • 1
  • 5
  • 4
    Sorry. What were the input? And what is the desired output? – Koala Yeung Apr 04 '19 at 05:54
  • 3
    Possible duplicate of [Creating this date format in PHP: YYYY-MM-DDTHH:MM:SS+-HH:MM](https://stackoverflow.com/questions/36804421/creating-this-date-format-in-php-yyyy-mm-ddthhmmss-hhmm) – Sean Apr 04 '19 at 05:59

2 Answers2

4

A look into the docu helps: https://www.php.net/manual/en/function.date.php

And the solution is:

date('c')

(with an additional colon)

Wiimm
  • 2,971
  • 1
  • 15
  • 25
0
date('c') // c - The ISO-8601 date format.
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Rikal
  • 215
  • 2
  • 12