happy cat image

Start Web Coding

Your First step toward web coding,
Start Web Coding

change UI

Convert string time value to time stamp value : strtotime()

functiion : strtotime()

    strtotime(Time value as string);

For example, if the string is '2021-04-17', write the code as follows:

<?php
    $date = '2021-04-17';
    echo strtotime($date);
?>

So let's run the code above.

<?php
    $date = '2021-04-17';
    echo strtotime($date);
?>

Here is the result screen: The time value keeps changing, so when you run it, it will output different values ​​than the image.

strtotime php

강좌로 돌아가기