1<?xml version="1.0" encoding="UTF-8"?>
2<helpdocument version="1.0">
3
4<!--***********************************************************
5 *
6 * Licensed to the Apache Software Foundation (ASF) under one
7 * or more contributor license agreements.  See the NOTICE file
8 * distributed with this work for additional information
9 * regarding copyright ownership.  The ASF licenses this file
10 * to you under the Apache License, Version 2.0 (the
11 * "License"); you may not use this file except in compliance
12 * with the License.  You may obtain a copy of the License at
13 *
14 *   http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing,
17 * software distributed under the License is distributed on an
18 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19 * KIND, either express or implied.  See the License for the
20 * specific language governing permissions and limitations
21 * under the License.
22 *
23 ***********************************************************-->
24
25
26
27
28<meta>
29<topic id="textscalc0104060102xml" indexer="include">
30<title id="tit" xml-lang="en-US">Date &amp; Time Functions</title>
31<filename>/text/scalc/01/04060102.xhp</filename>
32</topic>
33</meta>
34<body>
35<bookmark xml-lang="en-US" branch="index" id="bm_id3154536"><bookmark_value>date and time functions</bookmark_value>
36<bookmark_value>functions; date &amp; time</bookmark_value>
37<bookmark_value>Function Wizard; date &amp; time</bookmark_value>
38</bookmark>
39<paragraph role="heading" id="hd_id3154536" xml-lang="en-US" level="1" l10n="U" oldref="1">Date &amp; Time Functions</paragraph>
40<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.
41</variable></paragraph>
42<section id="howtoget">
43<embed href="text/scalc/00/00000404.xhp#eikadaze"/>
44</section>
45<section id="ADD_note">
46<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>
47</section>
48<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>
49<paragraph role="heading" id="hd_id2408825" xml-lang="en-US" level="2" l10n="NEW">Date base for day zero</paragraph>
50<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>
51<table id="tbl_id1661427">
52<tablerow>
53<tablecell>
54<paragraph role="tablehead" id="par_id6401257" xml-lang="en-US" l10n="NEW">Date base</paragraph>
55</tablecell>
56<tablecell>
57<paragraph role="tablehead" id="par_id5841242" xml-lang="en-US" l10n="NEW">Use</paragraph>
58</tablecell>
59</tablerow>
60<tablerow>
61<tablecell>
62<paragraph role="tablecontent" id="par_id6794030" xml-lang="en-US" l10n="CHG">'12/30/1899'</paragraph>
63</tablecell>
64<tablecell>
65<paragraph role="tablecontent" id="par_id7096774" xml-lang="en-US" l10n="NEW">(default)</paragraph>
66</tablecell>
67</tablerow>
68<tablerow>
69<tablecell>
70<paragraph role="tablecontent" id="par_id5699942" xml-lang="en-US" l10n="CHG">'01/01/1900'</paragraph>
71</tablecell>
72<tablecell>
73<paragraph role="tablecontent" id="par_id6420484" xml-lang="en-US" l10n="NEW">(used in former StarCalc 1.0)</paragraph>
74</tablecell>
75</tablerow>
76<tablerow>
77<tablecell>
78<paragraph role="tablecontent" id="par_id6986602" xml-lang="en-US" l10n="CHG">'01/01/1904'</paragraph>
79</tablecell>
80<tablecell>
81<paragraph role="tablecontent" id="par_id616779" xml-lang="en-US" l10n="NEW">(used in Apple software)</paragraph>
82</tablecell>
83</tablerow>
84</table>
85
86<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>
87<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>
88<paragraph role="heading" id="hd_id757469" xml-lang="en-US" level="2" l10n="NEW">Two digits years</paragraph>
89<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>
90<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>
91<paragraph role="heading" id="par_idN1067A" xml-lang="en-US" level="2" l10n="NEW">Functions</paragraph>
92<sort order="asc">
93<section id="workday">
94<paragraph role="paragraph" id="par_idN10683" xml-lang="en-US" l10n="NEW">
95<embedvar href="text/scalc/01/func_workday.xhp#workday"/>
96</paragraph>
97</section>
98<section id="yearfrac">
99<paragraph role="paragraph" id="par_id5189062" xml-lang="en-US" l10n="NEW">
100<embedvar href="text/scalc/01/func_yearfrac.xhp#yearfrac"/>
101</paragraph>
102</section>
103<section id="date">
104<paragraph role="paragraph" id="par_id6854457" xml-lang="en-US" l10n="NEW">
105<embedvar href="text/scalc/01/func_date.xhp#date"/>
106</paragraph>
107</section>
108<section id="datevalue">
109<paragraph role="paragraph" id="par_id3372295" xml-lang="en-US" l10n="NEW">
110<embedvar href="text/scalc/01/func_datevalue.xhp#datevalue"/>
111</paragraph>
112</section>
113<section id="edate">
114<paragraph role="paragraph" id="par_id5684377" xml-lang="en-US" l10n="NEW">
115<embedvar href="text/scalc/01/func_edate.xhp#edate"/>
116</paragraph>
117</section>
118<section id="today">
119<paragraph role="paragraph" id="par_id7576525" xml-lang="en-US" l10n="NEW">
120<embedvar href="text/scalc/01/func_today.xhp#today"/>
121</paragraph>
122</section>
123<section id="year">
124<paragraph role="paragraph" id="par_id641193" xml-lang="en-US" l10n="NEW">
125<embedvar href="text/scalc/01/func_year.xhp#year"/>
126</paragraph>
127</section>
128<section id="now">
129<paragraph role="paragraph" id="par_id6501968" xml-lang="en-US" l10n="NEW">
130<embedvar href="text/scalc/01/func_now.xhp#now"/>
131</paragraph>
132</section>
133<section id="weeknum">
134<paragraph role="paragraph" id="par_id3886532" xml-lang="en-US" l10n="NEW">
135<embedvar href="text/scalc/01/func_weeknum.xhp#weeknum"/>
136</paragraph>
137</section>
138<section id="weeknumadd">
139<paragraph role="paragraph" id="par_id614947" xml-lang="en-US" l10n="NEW">
140<embedvar href="text/scalc/01/func_weeknumadd.xhp#weeknumadd"/>
141</paragraph>
142</section>
143<section id="minute">
144<paragraph role="paragraph" id="par_id3953062" xml-lang="en-US" l10n="NEW">
145<embedvar href="text/scalc/01/func_minute.xhp#minute"/>
146</paragraph>
147</section>
148<section id="month">
149<paragraph role="paragraph" id="par_id2579729" xml-lang="en-US" l10n="NEW">
150<embedvar href="text/scalc/01/func_month.xhp#month"/>
151</paragraph>
152</section>
153<section id="eomonth">
154<paragraph role="paragraph" id="par_id1346781" xml-lang="en-US" l10n="NEW">
155<embedvar href="text/scalc/01/func_eomonth.xhp#eomonth"/>
156</paragraph>
157</section>
158<section id="networkdays">
159<paragraph role="paragraph" id="par_id8951384" xml-lang="en-US" l10n="NEW">
160<embedvar href="text/scalc/01/func_networkdays.xhp#networkdays"/>
161</paragraph>
162</section>
163<section id="eastersunday">
164<paragraph role="paragraph" id="par_id1074251" xml-lang="en-US" l10n="NEW">
165<embedvar href="text/scalc/01/func_eastersunday.xhp#eastersunday"/>
166</paragraph>
167</section>
168<section id="second">
169<paragraph role="paragraph" id="par_id372325" xml-lang="en-US" l10n="NEW">
170<embedvar href="text/scalc/01/func_second.xhp#second"/>
171</paragraph>
172</section>
173<section id="hour">
174<paragraph role="paragraph" id="par_id224005" xml-lang="en-US" l10n="NEW">
175<embedvar href="text/scalc/01/func_hour.xhp#hour"/>
176</paragraph>
177</section>
178<section id="day">
179<paragraph role="paragraph" id="par_id5375835" xml-lang="en-US" l10n="NEW">
180<embedvar href="text/scalc/01/func_day.xhp#day"/>
181</paragraph>
182</section>
183<section id="days">
184<paragraph role="paragraph" id="par_id1208838" xml-lang="en-US" l10n="NEW">
185<embedvar href="text/scalc/01/func_days.xhp#days"/>
186</paragraph>
187</section>
188<section id="days360">
189<paragraph role="paragraph" id="par_id7679982" xml-lang="en-US" l10n="NEW">
190<embedvar href="text/scalc/01/func_days360.xhp#days360"/>
191</paragraph>
192</section>
193<section id="weekday">
194<paragraph role="paragraph" id="par_id9172643" xml-lang="en-US" l10n="NEW">
195<embedvar href="text/scalc/01/func_weekday.xhp#weekday"/>
196</paragraph>
197</section>
198<section id="time">
199<paragraph role="paragraph" id="par_id2354503" xml-lang="en-US" l10n="NEW">
200<embedvar href="text/scalc/01/func_time.xhp#time"/>
201</paragraph>
202</section>
203<section id="timevalue">
204<paragraph role="paragraph" id="par_id7765434" xml-lang="en-US" l10n="NEW">
205<embedvar href="text/scalc/01/func_timevalue.xhp#timevalue"/>
206</paragraph>
207</section>
208</sort>
209<section id="relatedtopics">
210<embed href="text/scalc/01/04060100.xhp#drking"/>
211</section>
212</body>
213</helpdocument>
214