All Questions
10,399
questions
-4
votes
0
answers
22
views
Gent Rent availability in each hour for 2 weeks, depending on rent schedule, item quantity and current orders dates [closed]
I am trying to implement the function in PHP/Laravel (it is possible and advisable to use Carbon to work with dates) for this task, and don't know how to do this properly:
I have two arrays, one ...
1
vote
1
answer
55
views
Different between two date, result in years and days not month in php [duplicate]
I would like differences between two date results in Years and days not month
I have tried as below
$date1 = new DateTime("2023-01-01");
$date2 = new DateTime("2024-04-10");
$...
0
votes
1
answer
57
views
PHP Add 0.1 to 0 value for every two weeks past a specified date?
I'm looking to add .1 to the initial value of 0 every two weeks past a specified date.
Example:
Date = 05-26-2024; InitVal = 0; AddVal = 0.1;
The 26th was 4 weeks ago from 06-23-2024 which means 0 ...
0
votes
1
answer
46
views
PHP/Sql : Problem storing a custom date in the database
I want to manually add a updated/modified date for my WordPress posts. So, when I set a date manually and upload the post, the update date is displayed correctly (and the "_cstm_update_post" ...
2
votes
0
answers
41
views
PHP DateTime class returns wrong previous or next month on 31.05.2024 [duplicate]
I am developing a WordPress plugin called WP Date and Time Shortcode which counts to the PHP DateTime and DateTimeZone classes to display previous, current or next date and time based on some ...
0
votes
0
answers
39
views
php getting null date if value is not set by user
I have a html form with a date input.If i disable the input and set its value to a specific date when inserting this value to MySQL I get 1970-01-01 (null date). If I let the user choose the date from ...
1
vote
2
answers
48
views
Get posts by query excluding the current month
How would I get custom posts by a WordPress query that excludes the current month? I have a query created that shows the posts published in the current month...
<?php
$currentYear = date('Y'...
1
vote
2
answers
67
views
Finding Next Available Datetime Combining Weekly Schedule and Special Days in PHP
I'm working on a PHP project where I need to calculate the opening times for a business, which includes both regular weekly schedules and special non-standard times for holidays. I have two arrays: ...
0
votes
0
answers
24
views
How to get properly interval date period in laravel carbon
I have data like this (format yyyy-mm-dd):
start_date end_date
2012-06-01 2012-12-31
2013-01-01 2013-12-31
2014-01-01 2014-12-31
I expected ...
0
votes
1
answer
40
views
PHP Date Format Issue on blank date fields
strtotime return wrong value upon blank field - form submission
Date selection is working fine but empty field giving 01-01-1970
<form method="post">
<input type="date" ...
1
vote
1
answer
35
views
Date check in PHP while importing hand typed CSV
I am having a CSV to be prone to errors (typed by hand) to import to Oracle.
I want to check if the field in it is a valid (dd/mm/yyyy) date.
I wrote the following code
function check_date($a1,$a2,$a3,...
0
votes
2
answers
169
views
Using Carbon to generate multiple dates with an interval in a range, but only ones in the future
I need to generate multiple dates between two dates, based on an interval (eg. weekly, every 2 weeks, monthly, ...), but I only need the ones in the future.
For that I'm using the Carbon 2.72.3 ...
0
votes
2
answers
56
views
DATE with PHP oci_pdo and ORACLE db - TO_DATE doest work
I'm trying to write a date in a Oracle database date column using php and pdo_oci ,but I got the above error and I can't go on:
SQLSTATE[HY000]: General error: 1858 OCIStmtExecute: ORA-01858: a non-...
0
votes
3
answers
108
views
How to get specific week's Saturday date when week doesn't start with Monday?
As the title says, I'd like to get in PHP last week's Saturday date and current week's Saturday date with the constraint of a week starting with Saturday instead of Monday.
I first used strtotime('...
0
votes
1
answer
60
views
Carbon add method
Certainly something trivial, but I'm stuck!
I have a start date initialized like this:
$startDate = Carbon::createFromFormat('Y-m-d H:i', '2024-02-01 08:00');
I add days to this date to get an end ...