Changeset 16969
- Timestamp:
- Mar 13, 2008, 8:45:40 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.basic/help/date (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/help/date
r14175 r16969 1 1 2 date (variable)2 date [-var variable] [-seconds] [-reftime seconds] 3 3 4 Return the date and place it into (variable).4 Return the date and place it into (variable). 5 5 6 Default: print to window 6 Default: print to window 7 8 * by itself, just echoes the date & time 9 10 * to set a variable with the date, add -var name, where 'name' is the 11 name of your variable. by default, this is a human readable date, 12 eg Wed Mar 12 08:30:11 2008 13 14 * to calculate time differences, add the -seconds flag, and the value 15 will be in seconds since 1970 Jan 01 00:00:00. NOTE: There is a bug 16 in that the variable is represented as a float, and the value is now 17 > 1.2e9 seconds. The difference is thus not very accurate. To get 18 around this, use the -reftime feature to report the seconds since a 19 more recent date. A value of something like 1205340000 works at the 20 moment. 21 22 examples: 23 24 dvo: date 25 Wed Mar 12 08:30:11 2008 26 27 dvo: date -var foo -seconds 28 dvo: echo $foo 29 1205346664 30 31 dvo: date -var foo -seconds -reftime 1205340000 32 dvo: echo $foo 33 6700 34 dvo: date -var bar -seconds -reftime 1205340000 35 dvo: echo $bar 36 6708 37 dvo: echo {$bar - $foo} 38 8
Note:
See TracChangeset
for help on using the changeset viewer.
