TimeSerial: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "TIMESERIAL(''hour'', ''minute'', ''second'') '''Description''' TIMESERIAL returns a time constructed from the given hour, minute, and second. The required parameter, ''hour'...")
 
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
TIMESERIAL(''hour'', ''minute'', ''second'')
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''  


'''Description'''
TimeSerial(''hour'', ''minute'', ''second'')


TIMESERIAL returns a time constructed from the given hour, minute, and second. The required parameter, ''hour'', is any numeric expression ranging from 0 to 23. The required parameters, ''minute'' and ''second'', can be any numeric expression.
== Description ==


'''Example'''
TimeSerial returns a time constructed from the given hour, minute, and second. The required parameter, ''hour'', is any numeric expression ranging from 0 to 23. The required parameters, ''minute'' and ''second'', can be any numeric expression.
 
== Example (Basic) ==


<pre>
<pre>
REM TIMESERIAL Example
Rem TimeSerial Example
'TIMESERIAL builds a time from its parts
'TimeSerial builds a time from its parts
DIM FiveThirty, Noon
Dim FiveThirty, Noon
FiveThirty = TIMESERIAL(11 - 6, 30, 0)
FiveThirty = TimeSerial(11 - 6, 30, 0)
Noon = TIMESERIAL(12, 0, 0)
Noon = TimeSerial(12, 0, 0)
PRINT "Half past five:", FiveThirty
Print "Half past five:", FiveThirty
PRINT "Noon:", Noon
Print "Noon:", Noon
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
Line 25: Line 27:
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[dateserial|DateSerial]]
 
[[Category:Language Reference]]
 
[[Category:Date and Time]]


[[dateserial|DATESERIAL]]
[[Category:BASIC Functions]]

Latest revision as of 15:37, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

TimeSerial(hour, minute, second)

Description

TimeSerial returns a time constructed from the given hour, minute, and second. The required parameter, hour, is any numeric expression ranging from 0 to 23. The required parameters, minute and second, can be any numeric expression.

Example (Basic)

Rem TimeSerial Example
'TimeSerial builds a time from its parts
Dim FiveThirty, Noon
FiveThirty = TimeSerial(11 - 6, 30, 0)
Noon = TimeSerial(12, 0, 0)
Print "Half past five:", FiveThirty
Print "Noon:", Noon

Output

Half past five:      05:30:00 AM
Noon:  12:00:00 PM
(sample time output is system dependant)

Related Items

DateSerial