I want to convert the time which I got from $scheduleTime = Carbon::createFromTimestampUTC($scheduleTimestamp)->toTimeString();
which is currently giving me 07:32:40
now I want to convert it into seconds only using Carbon library is this possible to do so if yes then how?
Advertisement
Answer
well, its there in carbon itself just use secondsSinceMidnight()
and you are good to go.
$scheduleTimeSeconds = Carbon::createFromTimestampUTC($scheduleTimestamp)->secondsSinceMidnight();