Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

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

Syntax

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

Description

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).

Examples

Inputs

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').

Outputs

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

Details

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

Examples

% 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

date
date_to_num
date_to_vector


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit