1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
3cdf0e10cSrcweir
4*226a8927SAndrew Rist<!--***********************************************************
5cdf0e10cSrcweir *
6*226a8927SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
7*226a8927SAndrew Rist * or more contributor license agreements.  See the NOTICE file
8*226a8927SAndrew Rist * distributed with this work for additional information
9*226a8927SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
10*226a8927SAndrew Rist * to you under the Apache License, Version 2.0 (the
11*226a8927SAndrew Rist * "License"); you may not use this file except in compliance
12*226a8927SAndrew Rist * with the License.  You may obtain a copy of the License at
13*226a8927SAndrew Rist *
14*226a8927SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
15*226a8927SAndrew Rist *
16*226a8927SAndrew Rist * Unless required by applicable law or agreed to in writing,
17*226a8927SAndrew Rist * software distributed under the License is distributed on an
18*226a8927SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19*226a8927SAndrew Rist * KIND, either express or implied.  See the License for the
20*226a8927SAndrew Rist * specific language governing permissions and limitations
21*226a8927SAndrew Rist * under the License.
22*226a8927SAndrew Rist *
23*226a8927SAndrew Rist ***********************************************************-->
24*226a8927SAndrew Rist
25*226a8927SAndrew Rist
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweir
29cdf0e10cSrcweir<helpdocument version="1.0">
30cdf0e10cSrcweir<meta>
31cdf0e10cSrcweir<topic id="textsbasicshared03030130xhp" indexer="include" status="PUBLISH">
32cdf0e10cSrcweir<title id="tit" xml-lang="en-US">DatePart Function [Runtime]</title>
33cdf0e10cSrcweir<filename>/text/sbasic/shared/03030130.xhp</filename>
34cdf0e10cSrcweir</topic>
35cdf0e10cSrcweir<history>
36cdf0e10cSrcweir<created date="2005-04-25T13:49:19">DatePart</created>
37cdf0e10cSrcweir<lastedited date="2006-01-23T13:27:35">checked</lastedited>
38cdf0e10cSrcweir</history>
39cdf0e10cSrcweir</meta>
40cdf0e10cSrcweir<body>
41cdf0e10cSrcweir<section id="datepart">
42cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id249946"><bookmark_value>DatePart function</bookmark_value>
43cdf0e10cSrcweir</bookmark>
44cdf0e10cSrcweir<paragraph role="heading" id="par_idN10542" xml-lang="en-US" level="1" l10n="NEW"><link href="text/sbasic/shared/03030130.xhp">DatePart Function [Runtime]</link></paragraph>
45cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10546" xml-lang="en-US" l10n="CHG">The DatePart function returns a specified part of a date.</paragraph>
46cdf0e10cSrcweir</section>
47cdf0e10cSrcweir<paragraph role="heading" id="par_idN10549" xml-lang="en-US" level="2" l10n="NEW">Syntax:</paragraph>
48cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN105E8" xml-lang="en-US" l10n="NEW">DatePart (Add, Date [, Week_start [, Year_start]])</paragraph>
49cdf0e10cSrcweir<paragraph role="heading" id="par_idN105EB" xml-lang="en-US" level="2" l10n="NEW">Return value:</paragraph>
50cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN105EF" xml-lang="en-US" l10n="CHG">A Variant containing a date.</paragraph>
51cdf0e10cSrcweir<paragraph role="heading" id="par_idN105F2" xml-lang="en-US" level="2" l10n="NEW">Parameters:</paragraph>
52cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN105F6" xml-lang="en-US" l10n="NEW">
53cdf0e10cSrcweir<emph>Add</emph> - A string expression from the following table, specifying the date interval.</paragraph>
54cdf0e10cSrcweir<embed href="text/sbasic/shared/03030110.xhp#datetable"/>
55cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10604" xml-lang="en-US" l10n="NEW">
56cdf0e10cSrcweir<emph>Date</emph> - The date from which the result is calculated.</paragraph>
57cdf0e10cSrcweir<embed href="text/sbasic/shared/03030120.xhp#weekyear"/>
58cdf0e10cSrcweir<paragraph role="heading" id="par_idN10611" xml-lang="en-US" level="2" l10n="NEW">Example:</paragraph>
59cdf0e10cSrcweir<paragraph role="code" id="par_idN10615" xml-lang="en-US" l10n="NEW">Sub example_datepart</paragraph>
60cdf0e10cSrcweir<paragraph role="code" id="par_idN10618" xml-lang="en-US" l10n="NEW">msgbox DatePart("ww", "12/31/2005")</paragraph>
61cdf0e10cSrcweir<paragraph role="code" id="par_idN1061B" xml-lang="en-US" l10n="NEW">End Sub</paragraph>
62cdf0e10cSrcweir</body>
63cdf0e10cSrcweir</helpdocument>
64