Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
149 views

I’m tracking button clicks on my website and storing both client-side click time and server-side insert time in my database. Frontend (JavaScript) I capture the click timestamp like this: clicked_at: ...
Pavan Kalyan's user avatar
1 vote
1 answer
120 views

I want to be able to floor a time to the top of the hour, e.g. 14:50:35, becomes 14:00:00. Either unix timestamp or DateTime/DateTimeImmutable, etc. is OK, but I cannot figure out how to do it. I ...
user32457645's user avatar
2 votes
1 answer
56 views

I have this CarbonPeriod with start 2025-06-09 19:00 and end 2025-06-11 11:00. What I want is an array of the days with start and end date. So basicly an array like this, possibly with new ...
gizburdt's user avatar
1 vote
2 answers
62 views

Running the following script: var_dump( (DateTimeImmutable::createFromFormat( format : 'Y-m-d H:i:s', datetime: '2120-10-03 07:00:00', timezone: new DateTimeZone('Europe/...
DevelJoe's user avatar
  • 1,592
2 votes
2 answers
130 views

I have an object which have created property like unix timestamp integer. I try to convert this property to DateTime object and supposed the PHP will set up correct Timezone according application ...
Čamo's user avatar
  • 4,463
0 votes
1 answer
56 views

I am trying to search for future dated Woocommerce products, but the query is not working. As it happens, the _custom_date field values are stored in UK date format e.g. 24/01/2025. Any ideas? $args = ...
realvinner's user avatar
1 vote
2 answers
316 views

I'm working on a leave/holiday management system. As well as booking full days leave/holiday they can book half days (morning or afternoon off). I need to calculate the total amount of days during a ...
PeteB's user avatar
  • 153
0 votes
1 answer
51 views

We have code line: $result = "{$list[ 'ga_event_start_date' ]} - {$list[ 'ga_event_end_date' ]}"; And the dates display as 'd M y' We need to remove the 'y' numeral. Can this be done in ...
user801347's user avatar
  • 1,382
-1 votes
1 answer
82 views

Apologies up front: Self taught so sometimes I miss something really basic... I have a JS application where users can enter a time in a form and can revisit the form and edit the time later. The entry ...
Danny Rosenbloom's user avatar
0 votes
1 answer
124 views

Let's say I need to change a datetime object by adding or subtracting some months. How to avoid the well known PHP month calculations? $monthstoadd=-1; //today is 2025-01-24 $date=new DateTime("...
Tobia's user avatar
  • 9,667
0 votes
2 answers
94 views

At the end of each month i want to write down the month in serbian latin alphabeth format to write down the month in letters and the full year. Example: Januar 2024 Februar 2024 ... Decembar 2024 etc....
Igor Vidic's user avatar
1 vote
1 answer
76 views

date_default_timezone_set() & date() functions return correct date & time for all countries except for Greenland & Kazakhstan. The following returns 1 hour behind of the correct time in ...
Eric's user avatar
  • 632
0 votes
1 answer
54 views

I recently noticed that if I run the following command: echo date("Y-m-d h:i:s", strtotime("2024-11-26 23:30:00 +3600 seconds")); The result is 2024-11-27 12:30:00 which is ...
Steve Garrett's user avatar
3 votes
1 answer
454 views

I have this code: try { Carbon::createFromFormat('dmY', $rawDate)->format('Ymd'); } catch (InvalidFormatException $e) { echo 'Oops, bad date format.'; } If I feed in 31012024 as my $...
Ethan Field's user avatar
  • 4,746
1 vote
2 answers
723 views

I need to get orders only if order was created from given date, let's say: 01/11/2024. Then I would get order created from the day 01/11/2024 to the actual date (today). I found this code which does ...
JPashs's user avatar
  • 14.1k

15 30 50 per page
1
2 3 4 5
494