I am trying to get the current time and format it like:
"2018-09-26T21:40:29+02:00"
But when I try:
$isoDate = \Carbon\Carbon::now()->format('c');
as I understood passing a c
to format function will parse it to iso8601 but clearly thats not the case.
Any help on how to parse current time to ISO8601 OR 20181001T094006Z
c
should translate to ISO8601. Here's what I get when I runecho \Carbon\Carbon::now()->format("c");
: 2018-09-26T20:05:30+00:00 – SouterrainYmdTHisZ
– Fell2018-09-26T21:40:29+02:00
which is not acceptable from the web service that I am trying to sent, as they want smth like: 20181001T094006Z . I mean I know the ugly way of parsing it that way by extracting year month .... and concat but It must be smth that I am missing. – Pittsburgh\Carbon\Carbon::now()->format('YmdTHisZ')
I get:"20180926CEST2216517200"
thats what I need to know so add the answer to mark the question as problem solved. thanks. – Pittsburgh