1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--***********************************************************
4 *
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements.  See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership.  The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License.  You may obtain a copy of the License at
12 *
13 *   http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied.  See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 *
22 ***********************************************************-->
23
24<helpdocument version="1.0">
25<meta>
26<topic id="textscalc0104060102xml" indexer="include">
27<title id="tit" xml-lang="en-US">Date &amp; Time Functions</title>
28<filename>/text/scalc/01/04060102.xhp</filename>
29</topic>
30</meta>
31<body>
32<bookmark xml-lang="en-US" branch="index" id="bm_id3154536">
33<bookmark_value>date and time functions</bookmark_value>
34<bookmark_value>functions; date &amp; time</bookmark_value>
35<bookmark_value>Function Wizard; date &amp; time</bookmark_value>
36</bookmark>
37<paragraph role="heading" id="hd_id3154536" xml-lang="en-US" level="1" l10n="U" oldref="1">Date &amp; Time Functions</paragraph>
38<paragraph role="paragraph" id="par_id3153973" xml-lang="en-US" l10n="U" oldref="2"><variable id="datumzeittext">These spreadsheet functions are used for inserting and editing dates and times.
39</variable></paragraph>
40<section id="howtoget">
41<embed href="text/scalc/00/00000404.xhp#eikadaze"/>
42</section>
43<section id="ADD_note">
44<paragraph role="note" id="par_idN10600" xml-lang="en-US" l10n="NEW">The functions whose names end with _ADD return the same results as the corresponding Microsoft Excel functions. Use the functions without _ADD to get results based on international standards. For example, the WEEKNUM function calculates the week number of a given date based on international standard ISO 8601, while WEEKNUM_ADD returns the same week number as Microsoft Excel.<comment>UFI: see #33784#</comment></paragraph>
45</section>
46<paragraph role="paragraph" id="par_id3150437" xml-lang="en-US" l10n="U" oldref="170">$[officename] internally handles a date/time value as a numerical value. If you assign the numbering format "Number" to a date or time value, it is converted to a number. For example, 01/01/2000 12:00 PM, converts to 36526.5. The value preceding the decimal point corresponds to the date; the value following the decimal point corresponds to the time. If you do not want to see this type of numerical date or time representation, change the number format (date or time) accordingly. To do this, select the cell containing the date or time value, call its context menu and select <emph>Format Cells</emph>. The <emph>Numbers</emph> tab page contains the functions for defining the number format.</paragraph>
47<paragraph role="heading" id="hd_id2408825" xml-lang="en-US" level="2" l10n="NEW">Date base for day zero</paragraph>
48<paragraph role="paragraph" id="par_id9988402" xml-lang="en-US" l10n="NEW">Dates are calculated as offsets from a starting day zero. You can set the day zero to be one of the following:</paragraph>
49<table id="tbl_id1661427">
50<tablerow>
51<tablecell>
52<paragraph role="tablehead" id="par_id6401257" xml-lang="en-US" l10n="NEW">Date base</paragraph>
53</tablecell>
54<tablecell>
55<paragraph role="tablehead" id="par_id5841242" xml-lang="en-US" l10n="NEW">Use</paragraph>
56</tablecell>
57</tablerow>
58<tablerow>
59<tablecell>
60<paragraph role="tablecontent" id="par_id6794030" xml-lang="en-US" l10n="CHG">'12/30/1899'</paragraph>
61</tablecell>
62<tablecell>
63<paragraph role="tablecontent" id="par_id7096774" xml-lang="en-US" l10n="NEW">(default)</paragraph>
64</tablecell>
65</tablerow>
66<tablerow>
67<tablecell>
68<paragraph role="tablecontent" id="par_id5699942" xml-lang="en-US" l10n="CHG">'01/01/1900'</paragraph>
69</tablecell>
70<tablecell>
71<paragraph role="tablecontent" id="par_id6420484" xml-lang="en-US" l10n="NEW">(used in former StarCalc 1.0)</paragraph>
72</tablecell>
73</tablerow>
74<tablerow>
75<tablecell>
76<paragraph role="tablecontent" id="par_id6986602" xml-lang="en-US" l10n="CHG">'01/01/1904'</paragraph>
77</tablecell>
78<tablecell>
79<paragraph role="tablecontent" id="par_id616779" xml-lang="en-US" l10n="NEW">(used in Apple software)</paragraph>
80</tablecell>
81</tablerow>
82</table>
83<paragraph role="paragraph" id="par_id791039" xml-lang="en-US" l10n="NEW">Choose <emph><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - %PRODUCTNAME Calc - Calculate</emph> to select the date base.</paragraph>
84<paragraph role="warning" id="par_id1953489" xml-lang="en-US" l10n="NEW">When you copy and paste cells containing date values between different spreadsheets, both spreadsheet documents must be set to the same date base. If date bases differ, the displayed date values will change!</paragraph>
85<paragraph role="heading" id="hd_id757469" xml-lang="en-US" level="2" l10n="NEW">Two digits years</paragraph>
86<paragraph role="paragraph" id="par_id3149720" xml-lang="en-US" l10n="U" oldref="183">In <emph><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - $[officename] - General</emph> you find the area <emph>Year (two digits)</emph>. This sets the period for which two-digit information applies. Note that changes made here have an effect on some of the following functions.</paragraph>
87<paragraph role="note" id="par_id3150654" xml-lang="en-US" l10n="U" oldref="185">When entering dates, slashes or dashes used as date separators may be interpreted as arithmetic operators. Therefore, dates entered in this format are not always recognized as dates and result in erroneous calculations. To keep dates from being interpreted as parts of formulas, place them in quotation marks, for example, "07/20/54".</paragraph>
88<paragraph role="heading" id="par_idN1067A" xml-lang="en-US" level="2" l10n="NEW">Functions</paragraph>
89<sort order="asc">
90<section id="workday">
91<paragraph role="paragraph" id="par_idN10683" xml-lang="en-US" l10n="NEW">
92<embedvar href="text/scalc/01/func_workday.xhp#workday"/>
93</paragraph>
94</section>
95<section id="yearfrac">
96<paragraph role="paragraph" id="par_id5189062" xml-lang="en-US" l10n="NEW">
97<embedvar href="text/scalc/01/func_yearfrac.xhp#yearfrac"/>
98</paragraph>
99</section>
100<section id="date">
101<paragraph role="paragraph" id="par_id6854457" xml-lang="en-US" l10n="NEW">
102<embedvar href="text/scalc/01/func_date.xhp#date"/>
103</paragraph>
104</section>
105<section id="datevalue">
106<paragraph role="paragraph" id="par_id3372295" xml-lang="en-US" l10n="NEW">
107<embedvar href="text/scalc/01/func_datevalue.xhp#datevalue"/>
108</paragraph>
109</section>
110<section id="edate">
111<paragraph role="paragraph" id="par_id5684377" xml-lang="en-US" l10n="NEW">
112<embedvar href="text/scalc/01/func_edate.xhp#edate"/>
113</paragraph>
114</section>
115<section id="today">
116<paragraph role="paragraph" id="par_id7576525" xml-lang="en-US" l10n="NEW">
117<embedvar href="text/scalc/01/func_today.xhp#today"/>
118</paragraph>
119</section>
120<section id="year">
121<paragraph role="paragraph" id="par_id641193" xml-lang="en-US" l10n="NEW">
122<embedvar href="text/scalc/01/func_year.xhp#year"/>
123</paragraph>
124</section>
125<section id="now">
126<paragraph role="paragraph" id="par_id6501968" xml-lang="en-US" l10n="NEW">
127<embedvar href="text/scalc/01/func_now.xhp#now"/>
128</paragraph>
129</section>
130<section id="weeknum">
131<paragraph role="paragraph" id="par_id3886532" xml-lang="en-US" l10n="NEW">
132<embedvar href="text/scalc/01/func_weeknum.xhp#weeknum"/>
133</paragraph>
134</section>
135<section id="weeknumadd">
136<paragraph role="paragraph" id="par_id614947" xml-lang="en-US" l10n="NEW">
137<embedvar href="text/scalc/01/func_weeknumadd.xhp#weeknumadd"/>
138</paragraph>
139</section>
140<section id="minute">
141<paragraph role="paragraph" id="par_id3953062" xml-lang="en-US" l10n="NEW">
142<embedvar href="text/scalc/01/func_minute.xhp#minute"/>
143</paragraph>
144</section>
145<section id="month">
146<paragraph role="paragraph" id="par_id2579729" xml-lang="en-US" l10n="NEW">
147<embedvar href="text/scalc/01/func_month.xhp#month"/>
148</paragraph>
149</section>
150<section id="eomonth">
151<paragraph role="paragraph" id="par_id1346781" xml-lang="en-US" l10n="NEW">
152<embedvar href="text/scalc/01/func_eomonth.xhp#eomonth"/>
153</paragraph>
154</section>
155<section id="networkdays">
156<paragraph role="paragraph" id="par_id8951384" xml-lang="en-US" l10n="NEW">
157<embedvar href="text/scalc/01/func_networkdays.xhp#networkdays"/>
158</paragraph>
159</section>
160<section id="eastersunday">
161<paragraph role="paragraph" id="par_id1074251" xml-lang="en-US" l10n="NEW">
162<embedvar href="text/scalc/01/func_eastersunday.xhp#eastersunday"/>
163</paragraph>
164</section>
165<section id="second">
166<paragraph role="paragraph" id="par_id372325" xml-lang="en-US" l10n="NEW">
167<embedvar href="text/scalc/01/func_second.xhp#second"/>
168</paragraph>
169</section>
170<section id="hour">
171<paragraph role="paragraph" id="par_id224005" xml-lang="en-US" l10n="NEW">
172<embedvar href="text/scalc/01/func_hour.xhp#hour"/>
173</paragraph>
174</section>
175<section id="day">
176<paragraph role="paragraph" id="par_id5375835" xml-lang="en-US" l10n="NEW">
177<embedvar href="text/scalc/01/func_day.xhp#day"/>
178</paragraph>
179</section>
180<section id="days">
181<paragraph role="paragraph" id="par_id1208838" xml-lang="en-US" l10n="NEW">
182<embedvar href="text/scalc/01/func_days.xhp#days"/>
183</paragraph>
184</section>
185<section id="days360">
186<paragraph role="paragraph" id="par_id7679982" xml-lang="en-US" l10n="NEW">
187<embedvar href="text/scalc/01/func_days360.xhp#days360"/>
188</paragraph>
189</section>
190<section id="weekday">
191<paragraph role="paragraph" id="par_id9172643" xml-lang="en-US" l10n="NEW">
192<embedvar href="text/scalc/01/func_weekday.xhp#weekday"/>
193</paragraph>
194</section>
195<section id="time">
196<paragraph role="paragraph" id="par_id2354503" xml-lang="en-US" l10n="NEW">
197<embedvar href="text/scalc/01/func_time.xhp#time"/>
198</paragraph>
199</section>
200<section id="timevalue">
201<paragraph role="paragraph" id="par_id7765434" xml-lang="en-US" l10n="NEW">
202<embedvar href="text/scalc/01/func_timevalue.xhp#timevalue"/>
203</paragraph>
204</section>
205</sort>
206<section id="relatedtopics">
207<embed href="text/scalc/01/04060100.xhp#drking"/>
208</section>
209</body>
210</helpdocument>
211