From WikiChip
Difference between revisions of "mirc/identifiers/$ctime"
< mirc‎ | identifiers

m (Bot: Automated text replacement (-Added On:.+\n?\n?\n?\n?\n? +))
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''$ctime''' allows you to retrieve the amount of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on your system time. Optionally, you can request the amount of seconds elapsed since a specified, optional time.
+
{{mirc title|$ctime Identifier}}'''$ctime''' allows you to retrieve the amount of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on your system time.<br />
 +
Optionally, you can request the amount of seconds elapsed between 00:00:00 GMT, January 1, 1970 and a specified time.
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$ctime[(text)]</pre>
+
<pre>$ctime
 +
$ctime(text)</pre>
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 70px;">'''text'''</span>The text can be any date that you would like to find the '''$ctime''' for.
+
<span style="display: inline-block; width: 70px;">'''text'''</span>The text can be any date for which you would like to find the '''$ctime'''.
  
 
== Examples ==
 
== Examples ==
'''Echo the current $ctime to the active window'''
+
<source lang="mIRC">
<source lang="mIRC">//echo -a $ctime</source>
+
Echo the current $ctime to the active window
 +
//echo -a $ctime
 +
Echo the $ctime of a specfic date and time to the active window
 +
//echo -a $ctime(Thursday 2003-01-09 21:16)
  
'''Echo the $ctime of a specfic date and time to the active window'''
+
Accepts a variety of formats, but n/n/n string is *always* day/month/year format:
<source lang="mIRC">//echo -a $ctime(Thursday 2003-01-09 21:16)</source>
+
//echo -a $ctime(January 1 1970 00:00:00) $ctime(3rd August 1987 3:46pm) $ctime(21/4/72 1:30:37) $ctime(Wed 1998-3-27 21:16)
 +
 
 +
When text is a date only, without a time, the $ctime returned is for the current time on that day.
 +
 
 +
$ctime returned for a fixed time string varies according to your computer's timezone and daylight saving settings:
 +
//echo -a Regardless of timezone/daylight settings $ctime(2/1/70 0:0) = 86400 + $timezone + $daylight
 +
 
 +
Prior to 7.52 beta, max valid ctime as input to $asctime is 2^32-1, but max timestring as input to $ctime is 2^32-2:
 +
//echo -a $ctime(Mon Jan 18 21:14:06 2038) is the max ctime returned from number string
 +
 
 +
With introduction of 64bit time related variables, the max time string is the time string which returns 32535244798.
 +
For USA Pacific zone this is $ctime(31/12/3000 23:59:58) and varies by an hour +east or -west of that zone.
 +
 
 +
From v7.37 through v7.52, returns ctime too high by 1 month when time string is the last second of any year:
 +
//var %i 1970 | while (%i isnum 1970-2038) { var %a $ctime(31/12/ $+ %i 23:59:59 ) | if (*Jan 31 23:59:59* !iswm $asctime(%a)) echo -a year %i vs $v2 | inc %i }
 +
</source>
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v5.4
+
{{mIRC compatibility|5.4}}
  
 
== See Also ==
 
== See Also ==
 +
{{collist
 +
|count = 3
 +
|style = width: 60%; display: inherit;
 +
|
 
* {{mIRC|$asctime}}
 
* {{mIRC|$asctime}}
 
* {{mIRC|$date}}
 
* {{mIRC|$date}}
 +
* {{mIRC|$adate}}
 
* {{mIRC|$time}}
 
* {{mIRC|$time}}
{{mIRC identifier list}}
+
* {{mIRC|$fulldate}}
 
+
* {{mIRC|$gmt}}
[[Category:MIRC identifiers]]
+
* {{mIRC|$ticks}}
 +
* {{mIRC|$day}}
 +
* {{mIRC|$daylight}}
 +
* {{mIRC|$timezone}}
 +
* {{mIRC|$duration}}
 +
* {{mIRC|$uptime}}
 +
}}

Latest revision as of 04:44, 22 May 2018

$ctime allows you to retrieve the amount of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on your system time.
Optionally, you can request the amount of seconds elapsed between 00:00:00 GMT, January 1, 1970 and a specified time.

Synopsis[edit]

$ctime
$ctime(text)

Parameters[edit]

textThe text can be any date for which you would like to find the $ctime.

Examples[edit]

Echo the current $ctime to the active window
//echo -a $ctime
Echo the $ctime of a specfic date and time to the active window
//echo -a $ctime(Thursday 2003-01-09 21:16)
 
Accepts a variety of formats, but n/n/n string is *always* day/month/year format:
//echo -a $ctime(January 1 1970 00:00:00) $ctime(3rd August 1987 3:46pm) $ctime(21/4/72 1:30:37) $ctime(Wed 1998-3-27 21:16)
 
When text is a date only, without a time, the $ctime returned is for the current time on that day.
 
$ctime returned for a fixed time string varies according to your computer's timezone and daylight saving settings:
//echo -a Regardless of timezone/daylight settings $ctime(2/1/70 0:0) = 86400 + $timezone + $daylight
 
Prior to 7.52 beta, max valid ctime as input to $asctime is 2^32-1, but max timestring as input to $ctime is 2^32-2:
//echo -a $ctime(Mon Jan 18 21:14:06 2038) is the max ctime returned from number string
 
With introduction of 64bit time related variables, the max time string is the time string which returns 32535244798.
For USA Pacific zone this is $ctime(31/12/3000 23:59:58) and varies by an hour +east or -west of that zone.
 
From v7.37 through v7.52, returns ctime too high by 1 month when time string is the last second of any year:
//var %i 1970 | while (%i isnum 1970-2038) { var %a $ctime(31/12/ $+ %i 23:59:59 ) | if (*Jan 31 23:59:59* !iswm $asctime(%a)) echo -a year %i vs $v2 | inc %i }

Compatibility[edit]

Added: mIRC v5.4
Added on: 23 Jun 1998
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also[edit]