Created
August 23, 2015 07:13
-
-
Save ilius/8f1cb053d718358b9cad to your computer and use it in GitHub Desktop.
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 jmktime($h='',$m='',$s='',$jm='',$jd='',$jy=''){ | |
$h=tr_num($h); $m=tr_num($m); $s=tr_num($s); $jm=tr_num($jm); $jd=tr_num($jd); $jy=tr_num($jy); | |
if($h=='' and $m=='' and $s=='' and $jm=='' and $jd=='' and $jy==''){ | |
return mktime(); | |
} | |
list($year,$month,$day)=jalali_to_gregorian($jy,$jm,$jd); | |
$epoch = mktime($h,$m,$s,$month,$day,$year); | |
$tz = new DateTimeZone('Asia/Tehran'); | |
$transition = $tz->getTransitions($epoch, $epoch)[0]; | |
$isdst = $transition["isdst"]; | |
$epoch = mktime($h,$m,$s,$month,$day,$year,$isdst); | |
return $epoch; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment