Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dates #12

Closed
rkang30 opened this issue Aug 31, 2017 · 3 comments
Closed

dates #12

rkang30 opened this issue Aug 31, 2017 · 3 comments

Comments

@rkang30
Copy link

rkang30 commented Aug 31, 2017

Hi,

I am trying to read and update the dates which are Carbon instances.

For reading,
I convert the Carbon instance to array when I read the date value. But I don't think this is the right way of doing it. Also, the PACE system only stores the date value but when I look at the carbon instance value in the API, the 'date' is displaying as date time value.

e.g. +"date": "2015-07-31 04:00:00.000000"
+"timezone_type": 3
+"timezone": "UTC"

For updating,
If I update the value with just a date ('Y-m-d'), would it cause an issue? Also, how do I update these date values?

Thanks,
Ryan

@rkang30
Copy link
Author

rkang30 commented Aug 31, 2017

I discovered the way for reading the carbon ($job->promiseDate->toDateString()) but I haven't found the way to update the carbon date...

@robgridley
Copy link
Owner

See the Carbon documentation. It extends PHP's built-in DateTime class.

Here are two examples which do the same thing:

$job->promiseDate = new Carbon('2017-08-31');

$job->promiseDate = Carbon::createFromDate(2017, 8, 31);

@rkang30
Copy link
Author

rkang30 commented Aug 31, 2017

Awesome. Thank you!

@rkang30 rkang30 closed this as completed Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants