Difference between revisions of "GetDateTimePart"

From Catglobe Wiki
Jump to: navigation, search
 
Line 1: Line 1:
[[Category:General_Functions]]
+
{{HelpFiles}}  
{{HelpFiles}}
+
 
 +
==== getDateTimePart ====
 +
 
 +
Returns a part of a specific date
  
====getDateTimePart====
+
'''Syntax'''
  
Returns a part of a specific date
+
getDateTimePart(''date'', ''part'')
  
'''Syntax'''
+
'''Arguments'''  
  
getDateTimePart(''date'', ''part'')
+
''date'': Is a date with the type of array
  
'''Arguments'''
+
''part'': is an expression with the type of number. It must be one of the built-in constants:
  
''date'': Is a date with the type of array
+
DateTime_Year
  
''part'': is an expression with the type of number. It must be one of the built-in constants:
+
DateTime_Month
  
DateTime_Year
+
DateTime_Day
  
DateTime_Month
+
DateTime_Hour
  
DateTime_Day
+
DateTime_Minute
  
DateTime_Hour
+
DateTime_Second
  
DateTime_Minute
+
DateTime_Millisecond
  
DateTime_Second
+
DateTime_Week
  
DateTime_Millisecond
+
DateTime_TimeZone (only 5.6++)
  
DateTime_Week
+
'''Return type'''
  
DateTime_TimeZone (only 5.6++)
+
number
  
'''Return type'''
+
'''Examples'''  
  
number
+
''number year = getDateTimePart(getDateTime(), DateTime_Year); ''
  
'''Examples'''
+
''print("The current year is " + year); ''
  
number year = getDateTimePart(getDateTime(), DateTime_Year);
+
''//Result: The current year is 2011 ''
  
print("The current year is " + year);
+
'''Availability'''
  
'''Availability'''
+
Version 4.8 __NOTOC__ <!-- imported from file: 397.htm-->
  
Version 4.8
+
[[Category:General_Functions]]
__NOTOC__
 
<!-- imported from file: 397.htm-->
 

Latest revision as of 11:25, 21 December 2011



getDateTimePart

Returns a part of a specific date

Syntax

getDateTimePart(date, part)

Arguments

date: Is a date with the type of array

part: is an expression with the type of number. It must be one of the built-in constants:

DateTime_Year

DateTime_Month

DateTime_Day

DateTime_Hour

DateTime_Minute

DateTime_Second

DateTime_Millisecond

DateTime_Week

DateTime_TimeZone (only 5.6++)

Return type

number

Examples

number year = getDateTimePart(getDateTime(), DateTime_Year);

print("The current year is " + year);

//Result: The current year is 2011

Availability

Version 4.8