From WikiChip
Editing mirc/identifiers/$ctime

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{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 />
+
{{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. Optionally, you can request the amount of seconds elapsed between 00:00:00 GMT, January 1, 1970 and a specified time.
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
+
<pre>$ctime[(text)]</pre>
$ctime(text)</pre>
 
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 70px;">'''text'''</span>The text can be any date for which you would like to find the '''$ctime'''.
+
<span style="display: inline-block; width: 70px;">'''text'''</span>The text can be any date that you would like to find the '''$ctime''' for.
  
 
== Examples ==
 
== Examples ==
<source lang="mIRC">
+
'''Echo the current $ctime to the active window'''
Echo the current $ctime to the active window
+
<source lang="mIRC">//echo -a $ctime</source>
//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 the $ctime of a specfic date and time to the active window'''
//echo -a Regardless of timezone/daylight settings $ctime(2/1/70 0:0) = 86400 + $timezone + $daylight
+
<source lang="mIRC">//echo -a $ctime(Thursday 2003-01-09 21:16)</source>
 
 
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 ==
Line 38: Line 19:
  
 
== 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|$fulldate}}
+
{{mIRC identifier list}}
* {{mIRC|$gmt}}
+
 
* {{mIRC|$ticks}}
+
[[Category:mIRC identifiers|ctime]]
* {{mIRC|$day}}
 
* {{mIRC|$daylight}}
 
* {{mIRC|$timezone}}
 
* {{mIRC|$duration}}
 
* {{mIRC|$uptime}}
 
}}
 

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)