Difference between revisions of "DateTime class"

From Catglobe Wiki
Jump to: navigation, search
Line 22: Line 22:
 
DateTime dt = new DateTime("2009/04/05");
 
DateTime dt = new DateTime("2009/04/05");
 
print(dt.ToString());
 
print(dt.ToString());
 +
</source>
 +
 +
<source lang="javascript">
 +
DateTime dt = new DateTime("2017/02/14");
 +
print(dt.AsArray);//{2017,2,14,0,0,0,0,7}
 
</source>
 
</source>

Revision as of 08:55, 14 February 2017

DateTime



The DateTime object

Constructors

  • (string value "Value to parse as a date, syntax is same as for constant values") - New based on a string representation of a date
  • (array value "Value to parse as a date") - New based on a array representation of a date

Methods

  • string ToString() - The string representation of the object.

Properties

  • array AsArray { get; } - Return value as the array representation of a date
  • string ObjectTypeName { get; } - The name of the type of object.
  • TypeInformation TypeInformation { get; } - Get information about this class.


Examples

DateTime dt = new DateTime("2009/04/05");
print(dt.ToString());
DateTime dt = new DateTime("2017/02/14");
print(dt.AsArray);//{2017,2,14,0,0,0,0,7}