Difference between revisions of "DateTime dayOfWeek"

From Catglobe Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:General_Functions]]
+
{{HelpFiles}}

+
 
 +
<br>
 +
 
 +
==== DateTime_dayOfWeek ====
 +
 
 +
Return day of week (Mon, Tue, Wed,...) of a datetime
 +
 
 +
'''Syntax'''
 +
 
 +
DateTime_dayOfWeek(datetime);
 +
 
 +
'''Arguments'''
 +
 
 +
*datetime: is array in which we get dayOfWeek
 +
 
 +
'''Return value'''
 +
 
 +
number in which:
  
====DateTime_dayOfWeek====
+
*0: DateTime_Sunday
 +
*1: DateTime_Monday
 +
*2: DateTime_Tuesday
 +
*3: DateTime_Wednesday
 +
*4: DateTime_Thursday
 +
*5: DateTime_Friday
 +
*6: DateTime_Saturday
  
Return day of week (Mon, Tue, Wed,...) of a datetime
+
'''Example'''
  
'''Syntax'''
+
''array a1 = {2009,5,23,10,0,0,0,19,57};''
  
DateTime_dayOfWeek(datetime);
+
''number d = DateTime_dayOfWeek(a1);''
  
'''Arguments'''
+
''if (d == 0) print("Sunday");''
  
* datetime: is array in which we get dayOfWeek
+
''else if (d == 1) print("Monday");''
  
'''Return value'''
+
''else if (d == 2) print("Tuesday");''
  
number in which:
+
''else if (d == 3) print("Wednesday");''
  
* 0: DateTime_Sunday
+
''else if (d == 4) print("Thursday");''
* 1: DateTime_Monday
 
* 2: DateTime_Tuesday
 
* 3: DateTime_Wednesday
 
* 4: DateTime_Thursday
 
* 5: DateTime_Friday
 
* 6: DateTime_Saturday
 
  
'''Example'''
+
''else if (d == 5) print("Friday");''
  
array a1 = {2009,5,23,10,0,0,0,19,57};
+
''else if (d == 6) print("Saturday");''
  
print(DateTime_dayOfWeek(a1));
+
''//Saturday''
  
// a1=6
+
'''Availability'''
  
'''Availability'''
+
Version 5.7 __NOTOC__ <!-- imported from file: 7528.htm-->
  
Version 5.7
+
[[Category:General_Functions]]
__NOTOC__
 
<!-- imported from file: 7528.htm-->
 

Latest revision as of 07:05, 21 December 2011




DateTime_dayOfWeek

Return day of week (Mon, Tue, Wed,...) of a datetime

Syntax

DateTime_dayOfWeek(datetime);

Arguments

  • datetime: is array in which we get dayOfWeek

Return value

number in which:

  • 0: DateTime_Sunday
  • 1: DateTime_Monday
  • 2: DateTime_Tuesday
  • 3: DateTime_Wednesday
  • 4: DateTime_Thursday
  • 5: DateTime_Friday
  • 6: DateTime_Saturday

Example

array a1 = {2009,5,23,10,0,0,0,19,57};

number d = DateTime_dayOfWeek(a1);

if (d == 0) print("Sunday");

else if (d == 1) print("Monday");

else if (d == 2) print("Tuesday");

else if (d == 3) print("Wednesday");

else if (d == 4) print("Thursday");

else if (d == 5) print("Friday");

else if (d == 6) print("Saturday");

//Saturday

Availability

Version 5.7