home contribute faq download

FunctX XQuery Functions

functx:next-day

The next day

Google
Webxqueryfunctions.com

Description

The functx:next-day function takes a date and returns a date representing the following day.

The $date argument must be castable to xs:date, meaning that it must have the type xs:date or xs:dateTime, or be an xs:string or untyped value of the form YYYY-MM-DD.

Arguments and Return Type

NameTypeDescription
$date xs:anyAtomicType? the date
return value xs:date?

XQuery Function Declaration

See XSLT definition.
XQuery Syntax for January 2007 (1.0):
declare namespace functx = "http://www.functx.com"; 
declare function functx:next-day 
  ( $date as xs:anyAtomicType? )  as xs:date? {
       
   xs:date($date) + xs:dayTimeDuration('P1D')
 } ;
XQuery Syntax for July 2004 - November 2005 (CR):
declare namespace functx = "http://www.functx.com"; 
declare function functx:next-day 
  ( $date as xdt:anyAtomicType? )  as xs:date? {
       
   xs:date($date) + xdt:dayTimeDuration('P1D')
 } ;
XQuery Syntax for May 2003:
declare namespace functx = "http://www.functx.com" 
define function next-day 
  ( $date as xdt:anyAtomicType? )  as xs:date? {
       
   xs:date($date) + xdt:dayTimeDuration('P1D')
 }

Examples

XQuery ExampleResults
functx:next-day(xs:date('2004-01-23'))
2004-01-24
functx:next-day(
     xs:dateTime('2005-12-31T12:00:13'))
2006-01-01

See Also

functx:previous-dayThe previous day

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Need XQuery Help?
D A T Y P I C
Training | Consulting | Development

XQuery by Priscilla WalmsleyGet the book!
XQuery by Priscilla Walmsley