• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/03_stdlib/20_time

  1 The `time()` function returns the current UNIX epoch time.
  2 
  3 
  4 -- Testcase --
  5 {%
  6         let timestamp = time();
  7         let testcmd = sprintf('t=$(date +%%s); [ $t -gt %d -a $t -lt %d ]', timestamp - 3, timestamp + 3);
  8 
  9         if (system(testcmd) == 0)
 10                 print("time() works\n");
 11         else
 12                 print("time() and `date +%s` yield different results!\n");
 13 %}
 14 -- End --
 15 
 16 -- Expect stdout --
 17 time() works
 18 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt