Created
April 3, 2016 20:00
-
-
Save rririanto/7ff268e580806fc1646c218c2478b3a0 to your computer and use it in GitHub Desktop.
Generator No Urut
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function generateUrut($id) | |
{ | |
$tz_object = new DateTimeZone('Asia/Makassar'); | |
//date_default_timezone_set('Brazil/East'); | |
$datetime = new DateTime(); | |
$datetime->setTimezone($tz_object); | |
$dater = $datetime->format('Ymd'); | |
$getid = sprintf('%04d',$id); | |
$result = sprintf('%s%s', $getid, $dater); | |
return $result; | |
} | |
$idurut = generateUrut(1); | |
echo $idurut; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment