php-carbon Questions
2
Solved
Laravel 5.4 supports the Postgres TIMESTAMP WITH TIME ZONE field type in migrations:
$table->timestampTz('scheduled_for');
Laravel can be set up to convert date fields (DATE, DATETIME, TIMEST...
Abuse asked 19/6, 2017 at 20:17
3
I am trying to get the current timestamp using Carbon or DateTime Class
I get wrong date but when I use date() function it return the correct date
I run the code on win server 2012
this is my code
...
Sebastian asked 19/6, 2018 at 9:24
2
Solved
I have a carbon instance
$a = Carbon\Carbon::now();
Carbon\Carbon {
"date": "2018-06-11 10:00:00",
"timezone_type": 3,
"timezone": "Europe/Vienna",
}
and a CarbonInterval instance
$b = ...
Skullcap asked 11/6, 2018 at 15:24
1
I have the users timezone stored (there is timezone column in the users DB table) and I want to display all $dates attributes on all models in the user’s timezone, if authenticated.
I'm trying to ...
Jolin asked 8/6, 2018 at 21:16
1
I found only this on any questions and answers out here but none are related to carbon.
Is there a way to do this in carbon:
$start = (new DateTime('2018-06-01'))->modify('first day of this mo...
Gans asked 1/6, 2018 at 11:15
2
Solved
According to the manual: http://carbon.nesbot.com/docs/#api-humandiff
to get an ago
When comparing a value in the past to default now
but whatever I do, I cannot get the ago
return $datetime...
Prevail asked 1/9, 2015 at 21:53
3
Solved
I want to have show dates translated in "de" and in this format:
Thu, Mar 8, 2018 - 6:30
I have in "app.php":
'locale' => 'de',
Then in a view Im using:
{{$post->date->toDayDateTim...
Bartholomew asked 16/3, 2018 at 17:38
3
Solved
i am trying to pull records that are 7 days old only , not older or earlier.
But its not working, i'm using Carbon.
->where(DB::raw('date(AppDate)'), Carbon::now()->subDays(7))
Loveinidleness asked 13/10, 2017 at 13:37
1
Solved
I'm trying to parse a date formated like :
2017-09-20T10:59:10.0000000 01:00
I'm using Carbon, so i tried :
Carbon::createFromFormat('Y-m-dTH:i:s.u vP', $date)
Which output :
The timezone co...
Inspirit asked 27/2, 2018 at 10:9
2
Solved
I'm trying to localize Carbon dates in a view in different languages with no success so far.
I retrieve dates from a Model and send them to a view:
Route::get('/tables/setup', function(){
...
Clavier asked 26/1, 2018 at 14:14
3
Solved
I want to count records where updated_at is 2 hours older than created_at.
Code
$teLang = $kentekens->where('updated_at', '>', 'created_at'->subHours(2));
Unfortunately this doesn't w...
Memorize asked 23/1, 2018 at 19:10
2
Solved
I'm trying to create an array of blackout dates for a reservation system in Laravel 4. There is one test row in my db with a start_date of 2016-01-24 and end_date of 2016-01-29.
This is the code t...
Himyarite asked 27/1, 2016 at 21:44
5
Solved
I'm using Laravel 4 to create my project.
I am currently building the comments section and I want to display how long ago the post was created, kind of like Facebook's '10 mins ago' & '2 weeks...
Fluff asked 23/6, 2013 at 11:19
4
Solved
I am trying to return created_at datetime from users table in JSON response in Laravel.
In my databaes it show the value as
2016-07-18 00:00:00 but when I try to return in JSON api it conv...
Eller asked 26/12, 2017 at 10:46
2
Solved
I think I have a relatively simple question, I just think I'm misunderstanding an aspect of it.
I have an index page where in one of the table cells I have an if statement:
@if (Carbon\Carbon::p...
Homogeneity asked 22/12, 2017 at 20:1
2
strange problem here.
I'm using Laravel but i'm pretty sure it has nothing to do with it per se, and my Carbon dates are always returning "monday" as the first day of the week. Problem is, i'm in ...
Tybi asked 22/6, 2016 at 10:27
1
Solved
I know I can get the week number with Carbon by calling $my_date->weekOfYear. Is there a way to set a date by week number?
I mean is there something for initializing a date to the first day of...
Gil asked 16/10, 2017 at 13:56
1
Solved
I have problem with Carbon and HTML5 input input[type=datetime-local] because this input sends datatime in format Y-m-d\TH:i (eg. 2016-11-20T11:45).
I have method in my controller:
public functi...
Savory asked 2/10, 2017 at 14:58
1
Solved
I'm trying to make my Laravel API exchange dates with my Angularjs frontend.
It works from Laravel to JS by first converting my mysql datetime initial value:
2015-08-19 10:00:00
using $newdate ...
Announce asked 20/8, 2015 at 15:16
5
Solved
I want to convert time interval in seconds into days hours minutes. I have tried this.
$value = '90060';
CarbonInterval::seconds($value)->forHumans();
I got the output
90060 seconds
...
Prut asked 14/9, 2017 at 4:41
1
We have small blog application in Laravel 5.3 in which i need some suggestion about setting time stamps on the following features
1.Admin can able to send notifications to all users with current t...
Nabala asked 6/2, 2017 at 7:39
4
Solved
I'm trying to get all records that belongs to last month, so far I managed to get all from last month but to date today, I'm not sure how I can get only for last month
$revenueMonth = Callback::wh...
Hardden asked 7/9, 2017 at 12:23
3
Solved
I'm building a small application on Laravel 5.4 I'm trying to receive dates from a datepicker widget from front end and parsing it into Carbon date format something like this:
Carbon\Carbon::parse...
Slumlord asked 7/7, 2017 at 5:19
2
I'm trying to show the full current month name in dutch. I've tried it like this:
\Carbon\Carbon::now()->subMonth()->format('F')
But then I see July so not what I want. My app service
prov...
Hageman asked 17/7, 2017 at 7:28
2
Solved
I'm having a table where I'm storing the data in date format through datepicker. While storing the date I'm doing something like this:
$data['schedule'] = Carbon::parse($request->schedule)->...
Tosch asked 3/7, 2017 at 8:14
© 2022 - 2024 — McMap. All rights reserved.