@
@
@Twitt2017-08-10 02:53:53
css
@Twitt, 2017-08-10 02:53:53

What does outgoing data mean in this context?

At one company I saw a test one, the essence is that two dates are given in the YYYY-MM-DD format, and this is the incoming data. You need to calculate the difference between these dates without functions that work with dates and without the datetime class.
And the output will be the following:
stdClass {
$years, Number of years between dates
$months, Number of months between dates
$days, Number of days between dates
}
But I do not quite understand what the outgoing data means here. That is, I have to write a class that has the above properties and make a date calculation method in it, or what? Why is outgoing data specified as in a class, but incoming just as dates? I don't understand this moment. In other words, can you explain how to chew the condition? I would start writing my class for working with the date and just pass two dates to the method (or to the constructor), but it seems to me that this is not the case, because the outgoing data is stdClass

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
ReActor Dmitry Vershansky, 2019-03-27
@HunteR-VRX

Are you talking about a gradient fill? If yes, then:

.element {
linear-gradient(to right, #00ff00, #ff0000, #0000ff);
}

L
link_irk, 2017-08-10
@link_irk

This means that the output from you requires an object of the built-in class stdClass.

$result = [
    'years' => 2,
    'month' => 5,
    'days' => 12,
];

var_dump((object)$result);

The snippet of code above casts the array to an object of the stdClass class, with the properties you need
. Alternatively, you can directly create an instance of the stdClass class
$result = new stdClass();
$result -> years = 1;
$result -> month = 6;
$result -> days = 24;
var_dump($result);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question