Timestamp to human date
#1

Hi, i want to make a PAWN converter timestamp to human date, i have a java function from a site... but i don't know how to make calculations like in java functions.

PHP код:
function EpochToHuman() {
    var 
document.ef.TimeStamp.value;
    if (
e.charAt(e.length 1) == "L") {
        
e.slice(0, -1)
    }
    
1;
    var 
e;
    var 
"";
    var 
0;
    if (
>= 1e14) {
        
+= "<b>Assuming that this timestamp is in microseconds (1/1,000,000 second):</b><br/>";
        
Math.round(1e6);
        
Math.round(1e3)
    } else if (
>= 1e11) {
        
+= "<b>Assuming that this timestamp is in milliseconds:</b><br/>";
        
Math.round(1e3)
    } else {
        if (
1e101;
        
1e3
    
}
    var 
= new Date(e);
    if (
isValidDate(i)) {
        var 
i.toLocaleString();
        var 
s.search(/GMT/i);
        if (
0) {
            
s.substring(0o)
        }
        
+= "<b>GMT</b>: " i.toGMTString();
        
+= '<br/><b>Your time zone</b>: <span title="' i.toLocaleString() + '">' '</span> <a title="convert to other time zones" href="http://www.epochconverter.com/epoch/timezones.php?epoch=' '">' localTimezone(i) + "</a>";
        if (
r+= "<br/>This conversion uses your timestamp in seconds. Remove the last 3 digits if you are trying to convert milliseconds."
    
} else {
        
+= "Sorry, I can't parse this date.<br/>Check your timestamp, strip letters and punctuation marks."
    
}
    
+= '<hr class="lefthr">';
    
document.getElementById("result1").innerHTML n

Can someone will tell me how to do the calculations?
Reply
#2

By default pawn does not have the required functions, but there is a plugin which will do what you want: https://sampforum.blast.hk/showthread.php?tid=294054
Reply
#3

Heh i resolved.. i made a PHP script..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)