1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <helpdocument version=
"1.0">
5 ***********************************************************************
7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 * Copyright 2008 by Sun Microsystems, Inc.
11 * OpenOffice.org - a multi-platform office productivity suite
13 * $RCSfile: 04060102.xhp,v $
14 * $Revision: 1.11.4.1 $
16 * This file is part of OpenOffice.org.
18 * OpenOffice.org is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Lesser General Public License version 3
20 * only, as published by the Free Software Foundation.
22 * OpenOffice.org is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License version 3 for more details
26 * (a copy is included in the LICENSE file that accompanied this code).
28 * You should have received a copy of the GNU Lesser General Public License
29 * version 3 along with OpenOffice.org. If not, see
30 * <http://www.openoffice.org/license.html>
31 * for a copy of the LGPLv3 License.
33 ************************************************************************
38 <topic id=
"textscalc0104060102xml" indexer=
"include">
39 <title id=
"tit" xml-lang=
"en-US">Date
& Time Functions
</title>
40 <filename>/text/scalc/
01/
04060102.xhp
</filename>
44 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3154536"><bookmark_value>date and time functions
</bookmark_value>
45 <bookmark_value>functions; date
& time
</bookmark_value>
46 <bookmark_value>Function Wizard; date
& time
</bookmark_value>
48 <paragraph role=
"heading" id=
"hd_id3154536" xml-lang=
"en-US" level=
"1" l10n=
"U" oldref=
"1">Date
& Time Functions
</paragraph>
49 <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.
50 </variable></paragraph>
51 <section id=
"howtoget">
52 <embed href=
"text/scalc/00/00000404.xhp#eikadaze"/>
54 <section id=
"ADD_note">
55 <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>
57 <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>
58 <paragraph role=
"heading" id=
"hd_id2408825" xml-lang=
"en-US" level=
"2" l10n=
"NEW">Date base for day zero
</paragraph>
59 <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>
60 <table id=
"tbl_id1661427">
63 <paragraph role=
"tablehead" id=
"par_id6401257" xml-lang=
"en-US" l10n=
"NEW">Date base
</paragraph>
66 <paragraph role=
"tablehead" id=
"par_id5841242" xml-lang=
"en-US" l10n=
"NEW">Use
</paragraph>
71 <paragraph role=
"tablecontent" id=
"par_id6794030" xml-lang=
"en-US" l10n=
"CHG">'
12/
30/
1899'
</paragraph>
74 <paragraph role=
"tablecontent" id=
"par_id7096774" xml-lang=
"en-US" l10n=
"NEW">(default)
</paragraph>
79 <paragraph role=
"tablecontent" id=
"par_id5699942" xml-lang=
"en-US" l10n=
"CHG">'
01/
01/
1900'
</paragraph>
82 <paragraph role=
"tablecontent" id=
"par_id6420484" xml-lang=
"en-US" l10n=
"NEW">(used in former StarCalc
1.0)
</paragraph>
87 <paragraph role=
"tablecontent" id=
"par_id6986602" xml-lang=
"en-US" l10n=
"CHG">'
01/
01/
1904'
</paragraph>
90 <paragraph role=
"tablecontent" id=
"par_id616779" xml-lang=
"en-US" l10n=
"NEW">(used in Apple software)
</paragraph>
95 <paragraph role=
"paragraph" id=
"par_id791039" xml-lang=
"en-US" l10n=
"NEW">Choose
<emph>Tools - Options - %PRODUCTNAME Calc - Calculate
</emph> to select the date base.
</paragraph>
96 <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>
97 <paragraph role=
"heading" id=
"hd_id757469" xml-lang=
"en-US" level=
"2" l10n=
"NEW">Two digits years
</paragraph>
98 <paragraph role=
"paragraph" id=
"par_id3149720" xml-lang=
"en-US" l10n=
"U" oldref=
"183">In
<emph>Tools - Options - $[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>
99 <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>
100 <paragraph role=
"heading" id=
"par_idN1067A" xml-lang=
"en-US" level=
"2" l10n=
"NEW">Functions
</paragraph>
102 <section id=
"workday">
103 <paragraph role=
"paragraph" id=
"par_idN10683" xml-lang=
"en-US" l10n=
"NEW">
104 <embedvar href=
"text/scalc/01/func_workday.xhp#workday"/>
107 <section id=
"yearfrac">
108 <paragraph role=
"paragraph" id=
"par_id5189062" xml-lang=
"en-US" l10n=
"NEW">
109 <embedvar href=
"text/scalc/01/func_yearfrac.xhp#yearfrac"/>
113 <paragraph role=
"paragraph" id=
"par_id6854457" xml-lang=
"en-US" l10n=
"NEW">
114 <embedvar href=
"text/scalc/01/func_date.xhp#date"/>
117 <section id=
"datevalue">
118 <paragraph role=
"paragraph" id=
"par_id3372295" xml-lang=
"en-US" l10n=
"NEW">
119 <embedvar href=
"text/scalc/01/func_datevalue.xhp#datevalue"/>
123 <paragraph role=
"paragraph" id=
"par_id5684377" xml-lang=
"en-US" l10n=
"NEW">
124 <embedvar href=
"text/scalc/01/func_edate.xhp#edate"/>
128 <paragraph role=
"paragraph" id=
"par_id7576525" xml-lang=
"en-US" l10n=
"NEW">
129 <embedvar href=
"text/scalc/01/func_today.xhp#today"/>
133 <paragraph role=
"paragraph" id=
"par_id641193" xml-lang=
"en-US" l10n=
"NEW">
134 <embedvar href=
"text/scalc/01/func_year.xhp#year"/>
138 <paragraph role=
"paragraph" id=
"par_id6501968" xml-lang=
"en-US" l10n=
"NEW">
139 <embedvar href=
"text/scalc/01/func_now.xhp#now"/>
142 <section id=
"weeknum">
143 <paragraph role=
"paragraph" id=
"par_id3886532" xml-lang=
"en-US" l10n=
"NEW">
144 <embedvar href=
"text/scalc/01/func_weeknum.xhp#weeknum"/>
147 <section id=
"weeknumadd">
148 <paragraph role=
"paragraph" id=
"par_id614947" xml-lang=
"en-US" l10n=
"NEW">
149 <embedvar href=
"text/scalc/01/func_weeknumadd.xhp#weeknumadd"/>
152 <section id=
"minute">
153 <paragraph role=
"paragraph" id=
"par_id3953062" xml-lang=
"en-US" l10n=
"NEW">
154 <embedvar href=
"text/scalc/01/func_minute.xhp#minute"/>
158 <paragraph role=
"paragraph" id=
"par_id2579729" xml-lang=
"en-US" l10n=
"NEW">
159 <embedvar href=
"text/scalc/01/func_month.xhp#month"/>
162 <section id=
"eomonth">
163 <paragraph role=
"paragraph" id=
"par_id1346781" xml-lang=
"en-US" l10n=
"NEW">
164 <embedvar href=
"text/scalc/01/func_eomonth.xhp#eomonth"/>
167 <section id=
"networkdays">
168 <paragraph role=
"paragraph" id=
"par_id8951384" xml-lang=
"en-US" l10n=
"NEW">
169 <embedvar href=
"text/scalc/01/func_networkdays.xhp#networkdays"/>
172 <section id=
"eastersunday">
173 <paragraph role=
"paragraph" id=
"par_id1074251" xml-lang=
"en-US" l10n=
"NEW">
174 <embedvar href=
"text/scalc/01/func_eastersunday.xhp#eastersunday"/>
177 <section id=
"second">
178 <paragraph role=
"paragraph" id=
"par_id372325" xml-lang=
"en-US" l10n=
"NEW">
179 <embedvar href=
"text/scalc/01/func_second.xhp#second"/>
183 <paragraph role=
"paragraph" id=
"par_id224005" xml-lang=
"en-US" l10n=
"NEW">
184 <embedvar href=
"text/scalc/01/func_hour.xhp#hour"/>
188 <paragraph role=
"paragraph" id=
"par_id5375835" xml-lang=
"en-US" l10n=
"NEW">
189 <embedvar href=
"text/scalc/01/func_day.xhp#day"/>
193 <paragraph role=
"paragraph" id=
"par_id1208838" xml-lang=
"en-US" l10n=
"NEW">
194 <embedvar href=
"text/scalc/01/func_days.xhp#days"/>
197 <section id=
"days360">
198 <paragraph role=
"paragraph" id=
"par_id7679982" xml-lang=
"en-US" l10n=
"NEW">
199 <embedvar href=
"text/scalc/01/func_days360.xhp#days360"/>
202 <section id=
"weekday">
203 <paragraph role=
"paragraph" id=
"par_id9172643" xml-lang=
"en-US" l10n=
"NEW">
204 <embedvar href=
"text/scalc/01/func_weekday.xhp#weekday"/>
208 <paragraph role=
"paragraph" id=
"par_id2354503" xml-lang=
"en-US" l10n=
"NEW">
209 <embedvar href=
"text/scalc/01/func_time.xhp#time"/>
212 <section id=
"timevalue">
213 <paragraph role=
"paragraph" id=
"par_id7765434" xml-lang=
"en-US" l10n=
"NEW">
214 <embedvar href=
"text/scalc/01/func_timevalue.xhp#timevalue"/>
218 <section id=
"relatedtopics">
219 <embed href=
"text/scalc/01/04060100.xhp#drking"/>