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

m
Line 1: Line 1:
{{mirc title|$gmt Identifier}}'''$gmt''' return the current GMT time value in {{mIRC|$ctime}} format. $gmt also accept a parameter, a date of the same format as {{mIRC|$asctime}}.
+
{{mirc title|$gmt Identifier}}'''$gmt''' return the current GMT time value in {{mIRC|$ctime}} format. $gmt also accept optional time and/or format parameters, displaying the same format as {{mIRC|$asctime}}, adjusted by $timezone.
  
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$gmt</pre>
+
<pre>$gmt
<pre>$gmt(<date>)</pre>
+
$gmt(date [,format])</pre>
 
 
 
 
 
== Paramters ==
 
== Paramters ==
 
+
'''no parameters''' Returns ctime adjusted by the $timezone value
<span style="display: inline-block; width: 50px;">'''date'''</span>A date respecting the same format supported by {{mIRC|$asctime}}, returns the corresponding GMT time from that date.
+
'''date''' Optional ctime date, overrides the default ctime. Returns the GMT time string in $asctime format.
 
+
'''format''' Optional format letters same as for {{mIRC|$asctime}}
 
== Properties ==
 
== Properties ==
 
 
None
 
None
  
 
== Example ==
 
== Example ==
<source lang="mIRC">//echo -a $gmt</source>
+
<source lang="mIRC">
 +
//echo -a $gmt($ctime) is the same as $asctime($calc($ctime + $timezone  ) )
 +
//echo -a $gmt is same as $ctime + $timezone
 +
//echo -a $gmt($calc(0+$daylight)) is Thu Jan 01 00:00:00 1970
 +
</source>
  
 
== Compatibility ==
 
== Compatibility ==
Line 22: Line 23:
  
 
== See Also ==
 
== See Also ==
{{mIRC|$ticks}}
+
{{collist
{{mIRC|$date}}
+
|count = 3
{{mIRC|$fulldate}}
+
|style = width: 60%; display: inherit;
{{mIRC|$time}}
+
|
{{mIRC|$timezone}}
+
* {{mIRC|$asctime}}
{{mIRC|$asctime}}
+
* {{mIRC|$date}}
{{mIRC|$duration}}
+
* {{mIRC|$adate}}
 
+
* {{mIRC|$time}}
[[Category:mIRC identifiers|gmt]]
+
* {{mIRC|$ctime}}
 +
* {{mIRC|$fulldate}}
 +
* {{mIRC|$ticks}}
 +
* {{mIRC|$day}}
 +
* {{mIRC|$daylight}}
 +
* {{mIRC|$timezone}}
 +
* {{mIRC|$duration}}
 +
* {{mIRC|$uptime}}
 +
}}

Revision as of 13:40, 22 May 2018

$gmt return the current GMT time value in $ctime format. $gmt also accept optional time and/or format parameters, displaying the same format as $asctime, adjusted by $timezone.


Synopsis

$gmt
$gmt(date [,format])

Paramters

no parameters Returns ctime adjusted by the $timezone value date Optional ctime date, overrides the default ctime. Returns the GMT time string in $asctime format. format Optional format letters same as for $asctime

Properties

None

Example

//echo -a $gmt($ctime) is the same as $asctime($calc($ctime + $timezone  ) )
//echo -a $gmt is same as $ctime + $timezone
//echo -a $gmt($calc(0+$daylight)) is Thu Jan 01 00:00:00 1970

Compatibility

Added: mIRC v5.5
Added on: 08 Jan 1999
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also