Date
From UBot Studio
(Difference between revisions)
(→Example) |
(→Example 1) |
||
(4 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | $Date is a [[ | + | $Date is a [[Time Functions|Time Function]]. |
The function returns the current system date and time. This function will provide whatever the date and time is on the system the bot or script | The function returns the current system date and time. This function will provide whatever the date and time is on the system the bot or script | ||
is running on. | is running on. | ||
− | == Example == | + | == Example 1 == |
<pre> | <pre> | ||
Line 13: | Line 13: | ||
− | [[File: | + | [[File:date43.jpg]] |
+ | |||
+ | == Example 2 == | ||
+ | |||
+ | To grab only the time from the resulting system time and date, simply use the [[substring]] function to retrieve the information needed, as seen below. | ||
+ | |||
+ | |||
+ | <pre> | ||
+ | set(#one, $date, "Global") | ||
+ | set(#two, $substring(#one, 11, 8), "Global") | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | |||
+ | The script above will set only the time from the time and date sequence to the variable #two. | ||
+ | |||
+ | The resulting time will be: | ||
+ | |||
+ | <pre> | ||
+ | 22:20:43 | ||
+ | </pre> |
Latest revision as of 22:47, 28 December 2016
$Date is a Time Function.
The function returns the current system date and time. This function will provide whatever the date and time is on the system the bot or script is running on.
[edit] Example 1
type text(<username field>, $date, "Standard")
Running the script fills the designated field in the type text function with the date and time on the current system.
[edit] Example 2
To grab only the time from the resulting system time and date, simply use the substring function to retrieve the information needed, as seen below.
set(#one, $date, "Global") set(#two, $substring(#one, 11, 8), "Global")
The script above will set only the time from the time and date sequence to the variable #two.
The resulting time will be:
22:20:43