Skip to content

PHP: Simplify UNIX time generation - #2

Merged
rozenws merged 1 commit into
sumsub:masterfrom
antonkomarev:patch-2
Apr 6, 2021
Merged

PHP: Simplify UNIX time generation#2
rozenws merged 1 commit into
sumsub:masterfrom
antonkomarev:patch-2

Conversation

@antonkomarev

@antonkomarev antonkomarev commented Mar 26, 2021

Copy link
Copy Markdown
Contributor

There is not need to use strtotime + round if we could just use time function.

var_dump(round(strtotime("now")));
var_dump(strtotime("now"));
var_dump(time());
die;

// float(1616512755)
// int(1616512755)
// int(1616512755)

https://www.php.net/manual/en/function.time.php

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

@antonkomarev antonkomarev changed the title Simplify UNIX time generation PHP: Simplify UNIX time generation Mar 26, 2021
@antonkomarev

Copy link
Copy Markdown
Contributor Author

@rozenws

@rozenws
rozenws merged commit 1e18fcf into sumsub:master Apr 6, 2021
@antonkomarev
antonkomarev deleted the patch-2 branch April 6, 2021 18:59
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

Successfully merging this pull request may close these issues.

2 participants