1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2cdf0e10cSrcweir 3226a8927SAndrew Rist<!--*********************************************************** 41ca2cdb3Smseidel * 5226a8927SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 6226a8927SAndrew Rist * or more contributor license agreements. See the NOTICE file 7226a8927SAndrew Rist * distributed with this work for additional information 8226a8927SAndrew Rist * regarding copyright ownership. The ASF licenses this file 9226a8927SAndrew Rist * to you under the Apache License, Version 2.0 (the 10226a8927SAndrew Rist * "License"); you may not use this file except in compliance 11226a8927SAndrew Rist * with the License. You may obtain a copy of the License at 121ca2cdb3Smseidel * 13226a8927SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 141ca2cdb3Smseidel * 15226a8927SAndrew Rist * Unless required by applicable law or agreed to in writing, 16226a8927SAndrew Rist * software distributed under the License is distributed on an 17226a8927SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18226a8927SAndrew Rist * KIND, either express or implied. See the License for the 19226a8927SAndrew Rist * specific language governing permissions and limitations 20226a8927SAndrew Rist * under the License. 211ca2cdb3Smseidel * 22226a8927SAndrew Rist ***********************************************************--> 23226a8927SAndrew Rist 24cdf0e10cSrcweir<helpdocument version="1.0"> 25cdf0e10cSrcweir<meta> 26cdf0e10cSrcweir<topic id="textsbasicshared03030130xhp" indexer="include" status="PUBLISH"> 27cdf0e10cSrcweir<title id="tit" xml-lang="en-US">DatePart Function [Runtime]</title> 28cdf0e10cSrcweir<filename>/text/sbasic/shared/03030130.xhp</filename> 29cdf0e10cSrcweir</topic> 301ca2cdb3Smseidel<comment>DatePart</comment> 31cdf0e10cSrcweir</meta> 32cdf0e10cSrcweir<body> 33cdf0e10cSrcweir<section id="datepart"> 34*8b0727e7Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id249946"> 35*8b0727e7Smseidel<bookmark_value>DatePart function</bookmark_value> 36cdf0e10cSrcweir</bookmark> 37cdf0e10cSrcweir<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> 38cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10546" xml-lang="en-US" l10n="CHG">The DatePart function returns a specified part of a date.</paragraph> 39cdf0e10cSrcweir</section> 40cdf0e10cSrcweir<paragraph role="heading" id="par_idN10549" xml-lang="en-US" level="2" l10n="NEW">Syntax:</paragraph> 41cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN105E8" xml-lang="en-US" l10n="NEW">DatePart (Add, Date [, Week_start [, Year_start]])</paragraph> 42cdf0e10cSrcweir<paragraph role="heading" id="par_idN105EB" xml-lang="en-US" level="2" l10n="NEW">Return value:</paragraph> 43cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN105EF" xml-lang="en-US" l10n="CHG">A Variant containing a date.</paragraph> 44cdf0e10cSrcweir<paragraph role="heading" id="par_idN105F2" xml-lang="en-US" level="2" l10n="NEW">Parameters:</paragraph> 45cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN105F6" xml-lang="en-US" l10n="NEW"> 46cdf0e10cSrcweir<emph>Add</emph> - A string expression from the following table, specifying the date interval.</paragraph> 47cdf0e10cSrcweir<embed href="text/sbasic/shared/03030110.xhp#datetable"/> 48cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10604" xml-lang="en-US" l10n="NEW"> 49cdf0e10cSrcweir<emph>Date</emph> - The date from which the result is calculated.</paragraph> 50cdf0e10cSrcweir<embed href="text/sbasic/shared/03030120.xhp#weekyear"/> 51cdf0e10cSrcweir<paragraph role="heading" id="par_idN10611" xml-lang="en-US" level="2" l10n="NEW">Example:</paragraph> 52cdf0e10cSrcweir<paragraph role="code" id="par_idN10615" xml-lang="en-US" l10n="NEW">Sub example_datepart</paragraph> 53cdf0e10cSrcweir<paragraph role="code" id="par_idN10618" xml-lang="en-US" l10n="NEW">msgbox DatePart("ww", "12/31/2005")</paragraph> 54cdf0e10cSrcweir<paragraph role="code" id="par_idN1061B" xml-lang="en-US" l10n="NEW">End Sub</paragraph> 55cdf0e10cSrcweir</body> 56cdf0e10cSrcweir</helpdocument> 57