date_to_str (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: time

Requires: MathScript RT Module


s = date_to_str(n)

s = date_to_str(n, dateform)

s = date_to_str(s1, dateform)

s = date_to_str(v, dateform)

s = date_to_str(s1, dateform, pivotyear)

Legacy Name: datestr


Converts a time in any supported format to a string. s = date_to_str(s1, dateform) is equivalent to s= date_to_str(s1, dateform, -1).



Name Description
n Specifies a time in floating-number format.
dateform Specifies the format for the output string. dateform is a string.
s1 Specifies a time in string format.
v Specifies a time in vector format.
pivotyear Provides additional information about the century if you use the form yy in s1. If you specify a pivotyear, LabVIEW considers s1 to be a time in pivotyear or the 99 years that follow pivotyear. For example, the result of date_to_str('18-Oct-04', 'yyyy/mm/dd', 1900) is equivalent to the result of date_to_str('18-Oct-1904', 'yyyy/mm/dd'). However, if you do not specify pivotyear, or if pivotyear is less than 0, LabVIEW considers s1 to be within a century centered on the current year, or the current year plus or minus 50 years. For example, the result of date_to_str('18-Oct-04', 'yyyy/mm/dd') is equivalent to the result of date_to_str('18-Oct-2004', 'yyyy/mm/dd').


Name Description
s Returns the time as a string in the dateform format.


The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized


% S = date_to_str(s1, dateform, pivotyear)
S = date_to_str('18-Oct-04', 'yyyy/mm/dd', 1900)

% S = date_to_str(s1, dateform)
S = date_to_str('18-Oct-04', 'yyyy/mm/dd')

% S = date_to_str(v, dateform)
S = date_to_str([2004, 10, 18, 0, 0, 0] , 'yyyy/mm/dd')

% S = date_to_str(n, dateform)
S = date_to_str(2, 'yyyy/mm/dd')

Related Topics



Not Helpful