• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

PHP Converting from a string to a date

CarlEOgden

New Coder
Hi,

I've got an atom formatted date (apparently)!

Variable:
"created_date_time" => "2021-07-09T12:59:47.1630000Z"

Can someone point me in the best way to split it int Date/Time and in UK format?

I can split by T, split [0] by -, split [1] by . to remove right hand side and then I get 09/07/2021 12:59:47 and I think it's an hour behind!

Thanks in advance for all advice given
Carl.
 

Top