Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,4 +1,7 @@
|
|||
Output the system time (any units will do as long as they are noted) either by a [[Execute a System Command|system command]] or one built into the language. The system time can be used for debugging, network information, random number seeds, or something as simple as program performance.
|
||||
{{omit from|ML/I}}
|
||||
{{omit from|ZX Spectrum Basic|Does not have a real time clock.}}
|
||||
Output the system '''time''' (any units will do as long as they are noted) either by a [[Execute a System Command|system command]] or one built into the language.
|
||||
The system time can be used for debugging, network information, random number seeds, or something as simple as program performance.
|
||||
|
||||
'''See Also'''
|
||||
* [[Date format]]
|
||||
|
|
|
|||
|
|
@ -1,2 +1,5 @@
|
|||
---
|
||||
category:
|
||||
- Date and time
|
||||
- Simple
|
||||
note: Programming environment operations
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
$ awk 'BEGIN{print systime(),strftime()}'
|
||||
1242401632 Fri May 15 17:33:52 2009
|
||||
20
Task/System-time/AWK/system-time-2.awk
Normal file
20
Task/System-time/AWK/system-time-2.awk
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function dos_date( cmd,d,t,x) { # under MS Windows
|
||||
# cmd = "DATE /T"
|
||||
# cmd | getline d # Format depends on locale, e.g. MM/DD/YYYY or YYYY-MM-DD
|
||||
# close(cmd) # close pipe
|
||||
# ##print d
|
||||
# cmd = "TIME /T"
|
||||
# cmd | getline t # 13:59
|
||||
# close(cmd)
|
||||
# ##print t
|
||||
# return d t
|
||||
|
||||
cmd = "echo %DATE% %TIME%" # this gives better time-resolution
|
||||
cmd | getline x # 2014-10-31 20:57:36.84
|
||||
close(cmd)
|
||||
return x
|
||||
}
|
||||
BEGIN {
|
||||
print "Date and time:", dos_date()
|
||||
#print systime(), strftime() # gawk only
|
||||
}
|
||||
1
Task/System-time/Excel/system-time.excel
Normal file
1
Task/System-time/Excel/system-time.excel
Normal file
|
|
@ -0,0 +1 @@
|
|||
=NOW()
|
||||
1
Task/System-time/Io/system-time.io
Normal file
1
Task/System-time/Io/system-time.io
Normal file
|
|
@ -0,0 +1 @@
|
|||
Date now println
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
console.log(new Date()) // => Sat, 28 May 2011 08:22:53 GMT
|
||||
|
||||
console.log(Date.now()) // => 1306571005417 // Unix epoch
|
||||
|
|
|
|||
2
Task/System-time/NewLISP/system-time.newlisp
Normal file
2
Task/System-time/NewLISP/system-time.newlisp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
> (date)
|
||||
"Sun Sep 28 20:17:55 2014"
|
||||
|
|
@ -9,4 +9,4 @@ let {tm_sec = sec;
|
|||
tm_wday = wday;
|
||||
tm_yday = yday;
|
||||
tm_isdst = isdst} = localtime (time ());;
|
||||
Printf.printf "%04d-%02d-%02d %02d:%02d:%02d\n" (year + 1900) (mon + 1) mday hour min sec;;
|
||||
Printf.printf "%04d-%02d-%02d %02d:%02d:%02d\n" (year + 1900) (mon + 1) mday hour min sec;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;
|
||||
printf("%04d-%02d-%02d %02d:%02d:%02d\n", $year + 1900, $mon + 1, $mday, $hour, $min, $sec);
|
||||
printf("%04d-%02d-%02d %02d:%02d:%02d\n", $year + 1900, $mon + 1, $mday, $hour, $min, $sec
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
println(new java.util.Date)
|
||||
println(java.time.LocalTime.now())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue