Difference between revisions of "DateTime parse"

From Catglobe Wiki
Jump to: navigation, search
(Example)
(Example)
Line 95: Line 95:
 
<source lang="javascript">
 
<source lang="javascript">
  
array a = DateTime_parse(“2009/4/5”,”yyyy/MM/dd”); print(a);
+
array a = DateTime_parse("2009/4/5","yyyy/MM/dd"); print(a);
  
 
// or
 
// or
  
array a = DateTime_parse(“2009/4/5 0:0:0”,”yyyy/MM/dd hh:mm:ss”); print(a);
+
array a = DateTime_parse("2009/4/5 0:0:0","yyyy/MM/dd hh:mm:ss"); print(a);
  
 
// or
 
// or
  
array a = DateTime_parse(“2009/4/5 0:0:0”,”yyyy/MM/dd”); print(a);
+
array a = DateTime_parse("2009/4/5 0:0:0","yyyy/MM/dd”); print(a);
  
 
// or
 
// or
  
array a = DateTime_parse(“2009/4/5”,”yyyy/MM/dd hh:mm:ss”); print(a);
+
array a = DateTime_parse("2009/4/5","yyyy/MM/dd hh:mm:ss"); print(a);
  
 
//Repeat with seperator char -
 
//Repeat with seperator char -
Line 113: Line 113:
 
</source>
 
</source>
 
__NOTOC__
 
__NOTOC__
<!-- imported from file: 7546.htm-->
 

Revision as of 03:16, 20 December 2011


DateTime_parse

Return datetime after parsing

Syntax

DateTime_parse(rawDatetime, format);

Arguments

  • rawDatetime: is string
  • format: is string

Return value

An array, in which there are 9 items:

Index

Data type

Value

DateTime_Year

number

Value parsed from date time string

DateTime_Month

number

Value parsed from date time string

DateTime_Day

number

Value parsed from date time string

DateTime_Hour

number

Value parsed from date time string) (0 if date time string doesn't have it)

DateTime_Minute

number

Value parsed from date time string) (0 if date time string doesn't have it)

DateTime_Second

number

Value parsed from date time string) (0 if date time string doesn't have it)

DateTime_Millisecond

number

default 0

DateTime_Week

number

Depend on year, day, month

DateTime_TimeZone

number

Login user's timezone

Example

array a = DateTime_parse("2009/4/5","yyyy/MM/dd"); print(a);

// or

array a = DateTime_parse("2009/4/5 0:0:0","yyyy/MM/dd hh:mm:ss"); print(a);

// or

array a = DateTime_parse("2009/4/5 0:0:0","yyyy/MM/dd”); print(a);

// or

array a = DateTime_parse("2009/4/5","yyyy/MM/dd hh:mm:ss"); print(a);

//Repeat with seperator char -