Difference between revisions of "DateTime toJson"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "Category:General_Functions {{HelpFiles}} === DateTime_toJson<br/> === Convert [[|DateTime_class]] or DateTime array to string ===Syntax=== DateTime_toJson(DateTime[,...")
 
 
Line 1: Line 1:
[[Category:General_Functions]]
+
== DateTime_toJson==
{{HelpFiles}}
 
 
 
=== DateTime_toJson<br/> ===
 
 
 
 
Convert [[DateTime_class]] or DateTime array to string  
 
Convert [[DateTime_class]] or DateTime array to string  
 
+
==Syntax==
===Syntax===
 
 
 
 
DateTime_toJson(DateTime[, Type])
 
DateTime_toJson(DateTime[, Type])
 
+
== Arguments ==
=== Arguments ===
 
 
 
 
DateTime can be [[DateTime_class]] or DateTime array
 
DateTime can be [[DateTime_class]] or DateTime array
  
 
Type number: 0 for return full DateTime (default), 1 for return DateOnly, 2 for return TimeOnly
 
Type number: 0 for return full DateTime (default), 1 for return DateOnly, 2 for return TimeOnly
 
+
== Return type ==
=== Return type ===
 
 
 
 
string of datetime, format yyyy-MM-ddThh:mm:ss.msZ
 
string of datetime, format yyyy-MM-ddThh:mm:ss.msZ
 
+
== Examples ==
=== Examples ===
 
 
 
 
<source lang="javascript">
 
<source lang="javascript">
 
DateTime dateTime = new DateTime();
 
DateTime dateTime = new DateTime();
Line 30: Line 18:
 
dtJson = DateTime_toJson(dateTime, 2);//08:22:23.9900000
 
dtJson = DateTime_toJson(dateTime, 2);//08:22:23.9900000
 
</source>
 
</source>
 +
[[Category:General_Functions]]

Latest revision as of 10:08, 30 December 2024

DateTime_toJson

Convert DateTime_class or DateTime array to string

Syntax

DateTime_toJson(DateTime[, Type])

Arguments

DateTime can be DateTime_class or DateTime array

Type number: 0 for return full DateTime (default), 1 for return DateOnly, 2 for return TimeOnly

Return type

string of datetime, format yyyy-MM-ddThh:mm:ss.msZ

Examples

DateTime dateTime = new DateTime();
//array dateTime = getDateTime();
string dtJson;
dtJson = DateTime_toJson(dateTime);//2024-12-30T08:22:23.9900000Z
dtJson = DateTime_toJson(dateTime, 1);//2024-12-30
dtJson = DateTime_toJson(dateTime, 2);//08:22:23.9900000