XQuery current-dateTime() FunctionThe XQuery current-date time() function is used to return the current date and time. XQuery current-dateTime() ExampleUse the following XQuery expression to fetch the current date and time. current-datetime.xqy: Create a Java based XQuery executor program to read the current-datetime.xqy, passes it to the XQuery expression processor, and executes the expression. After that the result will be displayed. XQueryTester.java Execute XQuery against XMLPut the above both files to a same location. We put them on desktop in a folder name XQuery12. Compile XQueryTester.java using console. You must have JDK 1.5 or later installed on your computer and classpaths are configured. Compile: javac XQueryTester.java Execute: java XQueryTester Output: The above example shows both date and time. Next TopicXQuery If Then Else Statement |