Difference between revisions of "Documentation/How Tos/Calc: WEEKNUM function"
From Apache OpenOffice Wiki
< Documentation | How Tos
m |
m |
||
(12 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | __NOTOC__ | + | {{DISPLAYTITLE: WEEKNUM function}} |
+ | {{Documentation/CalcFunc DateTimeTOC | ||
+ | |ShowPrevNext=block | ||
+ | |PrevPage=Documentation/How_Tos/Calc:_WEEKSINYEAR_function | ||
+ | |NextPage=Documentation/How_Tos/Calc:_WEEKNUM_ADD_function | ||
+ | }}__NOTOC__ | ||
== WEEKNUM == | == WEEKNUM == | ||
Line 12: | Line 17: | ||
: <tt>'''mode'''</tt> specifies which day is considered the first day of the week: <tt>'''1'''</tt> for Sunday, <tt>'''2'''</tt> for Monday | : <tt>'''mode'''</tt> specifies which day is considered the first day of the week: <tt>'''1'''</tt> for Sunday, <tt>'''2'''</tt> for Monday | ||
− | : To mimic the non-ISO behaviour of the Excel <tt>'''WEEKNUM'''</tt> function, use <tt> | + | : To mimic the non-ISO behaviour of the Excel <tt>'''WEEKNUM'''</tt> function, use <tt>[[Documentation/How_Tos/Calc: WEEKNUM_ADD function|WEEKNUM_ADD]]</tt>. |
=== Example: === | === Example: === | ||
− | <tt>'''WEEKNUM("2010 | + | <tt>'''WEEKNUM("2010-01-07"; 2)'''</tt> |
: returns <tt>'''1'''</tt>. 7Jan10 is a Thursday, and 4Jan10 the Monday of that week. | : returns <tt>'''1'''</tt>. 7Jan10 is a Thursday, and 4Jan10 the Monday of that week. | ||
− | === | + | === Issues: === |
− | ''' | + | *<tt>'''WEEKNUM'''</tt> is called <tt>'''ISOWEEKNUM'''</tt> in the forthcoming ODFF standard. |
− | + | {{SeeAlso|EN| | |
+ | * [[Documentation/How_Tos/Calc: WEEKNUM_ADD function|WEEKNUM_ADD]] | ||
− | + | * [[Documentation/How_Tos/Calc: YEAR function|YEAR]] | |
+ | * [[Documentation/How_Tos/Calc: MONTH function|MONTH]] | ||
+ | * [[Documentation/How_Tos/Calc: DAY function|DAY]] | ||
+ | * [[Documentation/How_Tos/Calc: WEEKDAY function|WEEKDAY]] | ||
+ | * [[Documentation/How_Tos/Calc: HOUR function|HOUR]] | ||
+ | * [[Documentation/How_Tos/Calc: MINUTE function|MINUTE]] | ||
+ | * [[Documentation/How_Tos/Calc: SECOND function|SECOND]] | ||
− | + | * [[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]] | |
− | * | + | |
+ | * [[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]] | ||
+ | |||
+ | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | ||
+ | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | ||
+ | [[Category: Documentation/Reference/Calc/Date and Time functions]] |
Latest revision as of 14:05, 30 January 2024
- Date & Time Functions
- TODAYNOWYEARMONTHDAYWEEKDAYHOURMINUTESECONDDATEDATEVALUETIMETIMEVALUEEOMONTHEDATEWORKDAYNETWORKDAYSDAYSDAYS360DAYSINMONTHDAYSINYEARWEEKSWEEKSINYEARWEEKNUMWEEKNUM_ADDMONTHSYEARS
WEEKNUM
Returns the ISO week number of a given date.
Syntax:
WEEKNUM(date; mode)
- returns the international standard ISO8601 week number, where week 1 is the week that contains January 4th.
- date is the date as a date-time serial number or as text.
- mode specifies which day is considered the first day of the week: 1 for Sunday, 2 for Monday
- To mimic the non-ISO behaviour of the Excel WEEKNUM function, use WEEKNUM_ADD.
Example:
WEEKNUM("2010-01-07"; 2)
- returns 1. 7Jan10 is a Thursday, and 4Jan10 the Monday of that week.
Issues:
- WEEKNUM is called ISOWEEKNUM in the forthcoming ODFF standard.
See Also
-