i’m trying to convert a date like 2022-08-09 to a julian date for send it to JDE. The problem is that default php functions like juliantojd() return a different result. The result i expected was something like this https://nimishprabhu.com/tools/jde-julian-date-converter-online.html I got this function from a very old code that is doing the job in .asp I’m trying to convert this
Tag: php-carbon
Laravel query builder inject column value into Carbon query
I’ve got a query that I’m running in my project on a model called Domain, it returns all domains where the status column of a domain matches complete and a date column is before or equal to a specific set of days. I’ve recently refactored the model columns and have included a new column called domain_alert_period which is an integer
Check if data updated_at 24 hours ago OR a day ago (laravel)
I am able to get days ago for each row in dattable using carbon. (view CustomController.php) But before the user is able to edit the data. I want to check if the data is updated a day ago or 24 hours ago. if 24 hours or a day passed user can’t update the data if it is within 24 hours
Laravel Carbon change date to specific data
How to change f.e. only month and day in existing date variable(object ?)? I’ve got date type fields in db: And then I want in blade view change according to special conditions. Above code changes the date to something like “1970-01-01”. The year could stay as it is stored in current variable, but I need to know how change only
PHP Carbon format to New Date() on Javascript
I want my website changed to full server-side, or with little client-side. What format was used by Carbon to Javascript Date object? Something like this? Answer You can read here for Carbon documentation, and you can format Carbon instance whatever you like
Adding day/incrementing with a carbon formatted date
I’m using carbon to get today’s date and format it in a laravel blade template, which is not a problem at all, but when it comes to incrementing I’m having an issue I’m currently testing with just adding a single day, but I want to actually create table headers for today and the next 7 days. In my blade I
how to make Carbon null in laravel?
I’m making a table in Laravel and I want my “besttime” to be a nullable but it’s returning the current time if I keep it empty. (I’m using carbon because I want the H:i format without the seconds) here’s what my input looks like Answer I will suggest you to add mutators in model so you can keep code simpler
setISODate() by week number is giving incorrect month for the first week of the year [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question When I set date by week number of the year like this: I then get $date->month as 12 when expect to get 1. Is it
Dates not casting after upgrading to Laravel 7
I have just upgraded from Laravel 6 (PHP 7.4) to Laravel 7 (PHP 7.4) and casting dates in a model has completely stopped working. For example, in my User model, I have the following $dates array: …
How to format time data type in laravel
How can I format time data type in laravel? Please see my code below. Model protected $dates = [‘start_date’, ‘end_date’, ‘show_at’, ‘hide_at’, ‘created_at’, ‘updated_at’]; View {{ $promotion->…