Skip to content
Advertisement

Tag: datetime

DateTime with microseconds

In my code, I’m using DateTime objects to manipulate dates, then convert them to timestamp in order to save them in some JSON files. For some reasons, I want to have the same thing as DateTime (or something close), but with microseconds precision (that I would convert to float when inserting inside the JSON files). My question is : is

PHP Carbon Check If Chosen Date is Greater than Other Date

I’ve started using PHP Carbon for my application since it seems so much easier than using and manipulating date/time with the DateTime class. What I want to do is check if the chosen date ($chosen_date) is greater than another date ($whitelist_date). I have tried this in the code below: The original $chosen_date value comes from POST data. Here is the

Reformatting a datetime field into a more readable format

I am pulling a datetime field out of a database with PHP in the form of this: 2015-09-22T13:00:00 When I populate my html with this value it returns this (note: without the ‘T’): 2015-09-22 13:00:00 No biggie. What I’d like for the output format to look like is this: September 22nd, 2015 – 01:00PM GMT I can’t quite wrap my

Advertisement