65 lines
3.1 KiB
XML
65 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<helpdocument version="1.0">
|
|
<!--
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* This file incorporates work covered by the following license notice:
|
|
*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
* with this work for additional information regarding copyright
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
* except in compliance with the License. You may obtain a copy of
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
-->
|
|
|
|
<meta>
|
|
<topic id="textsbasicshared03030203xml" indexer="include" status="PUBLISH">
|
|
<title id="tit">Now Function</title>
|
|
<filename>/text/sbasic/shared/03030203.xhp</filename>
|
|
</topic>
|
|
</meta>
|
|
|
|
<body>
|
|
|
|
<section id="now">
|
|
<bookmark branch="index" id="bm_id3149416">
|
|
<bookmark_value>Now function</bookmark_value>
|
|
</bookmark>
|
|
|
|
<h1 id="hd_id641619720735711"><variable id="Now_H1"><link href="text/sbasic/shared/03030203.xhp">Now Function</link></variable></h1>
|
|
<paragraph id="par_id3149670" role="paragraph">Returns the current system date and time as a <emph>Date</emph> value.</paragraph>
|
|
</section>
|
|
<note id="par_id491610993401822">The <literal>Now</literal> function calculates time up to milliseconds, but return time in seconds.</note>
|
|
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
|
|
<bascode>
|
|
<paragraph id="par_id3149655" role="bascode" localize="false">Now</paragraph>
|
|
</bascode>
|
|
|
|
<embed href="text/sbasic/shared/00000003.xhp#functvalue"/>
|
|
<paragraph id="par_id3154909" role="paragraph">Date</paragraph>
|
|
|
|
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
|
|
<bascode>
|
|
<paragraph id="par_idm1341594784" role="bascode" localize="false">Sub ExampleNow</paragraph>
|
|
<paragraph id="par_id3150870" role="bascode"> MsgBox "It is now " & Now</paragraph>
|
|
<paragraph id="par_idm1341591760" role="bascode" localize="false">End Sub</paragraph>
|
|
<paragraph role="bascode" id="par_id891725483764420">REM Work with milliseconds timings</paragraph>
|
|
<paragraph role="bascode" id="par_id821725483772399" localize="false">Sub ExampleNowDouble</paragraph>
|
|
<paragraph role="bascode" id="par_id611725483783357" localize="false"> Dim myTime As Double</paragraph>
|
|
<paragraph role="bascode" id="par_id581725483789393" localize="false"> myTime = now</paragraph>
|
|
<paragraph role="bascode" id="par_id951725483796480"> MsgBox "It is now " & format(myTime, "yyyy-mm-dd HH:MM:SS.000")</paragraph>
|
|
<paragraph role="bascode" id="par_id51725483800615" localize="false">End Sub</paragraph>
|
|
</bascode>
|
|
|
|
<section id="relatedtopics">
|
|
<paragraph role="paragraph" id="par_id531610970649205" localize="false"><embedvar href="text/sbasic/shared/03/sf_timer.xhp#TimerService"/></paragraph>
|
|
</section>
|
|
|
|
</body>
|
|
</helpdocument>
|