public static string GetJavaScriptTime()
{
Int64 retval = 0;
DateTime st = new DateTime(1970, 1, 1);
TimeSpan t = (DateTime.Now - st);
retval = (Int64)(t.TotalMilliseconds + 0.5);
retval = retval + 1000000;
return retval.ToString();
}
Tag Archive for time
Get Java Script Time
Get the time elapsed between two intervals
var foo = new Date(); var bar = new Date(); var baz = new Date(); baz.setTime(bar.getTime() - foo.getTime()); alert(baz.getMilliseconds() + " ms elapsed between the definition of foo and bar.");
using find to list old files based on date
find /var/log -mtime -14 -type f -exec ls -al {} ;
Time-stamp configuration
;;;Turn on time-stamp updating. Timestamp must be in first 8 lines of file and look like: ;;; Time-stamp: <> (add-hook 'write-file-hooks 'time-stamp) ;;;;;;;;;;;;;;;;;;;;;;;;; (setq time-stamp-format ; format of the stamp ;;use describe-variable for info "[%f] modified by Noah Sussman on %:a, %:y.%02m.%02d at %02H : %02M : %02S on %s" time-stamp-active t ; update timestamps time-stamp-warn-inactive t) ; warn if unable
php code exution time
// put this at the top of the page
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
// put other code and html in here
// put this code at the bottom of the page
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "This page was created in ".$totaltime." seconds";
timestamp now
var now = Date.parse(new Date());
Delayed redirect
setTimeout( "window.location.href = 'http://walkerwines.com.au/'", 5*1000 );
Date
<?php
$time = date("Ymd H:i:s");
$year = date("Y");
echo ($time);
echo ($year);
?>