NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

date string

Hello,
The date() function in the expression browser has the following help verbage:
Date(, , , , , , )
This function returns the current date.
Parameter 1: An optional Boolean specifying whether to return the date in long format (the default is False).
Parameter 2: An optional number that returns the current year.
Parameter 3: An optional number that returns the current month (from 1 to 12).
Parameter 4: An optional number that returns the day of the month (from 1 to 31).
Parameter 5: An optional number that returns the day of the week (from 1 (Sunday) to 7 (Saturday)).
Parameter 6: An optional number that specifies a timestamp the function uses in place of the current time. Pass a time value you obtain from the expression function Seconds().
Parameter 7: An optional Boolean that specifies the base time for the timestamp you pass to parameter 6. Pass True if the base time is the time at which the application initialized the TestStand Engine. Pass False if the base time is midnight, January 1, 1970, universal coordinated time (UTC). UTC is also known as Greenwich mean time (GMT).
Returns: A string containing the current date in localized format.

The help implies there is a way to get it to return various parameters, such as timeStampInSeconds, or weekday, by passing in an "optional number". I have tried passing in various "numbers", but I cannot get it to return the information, such as weekday. I am having the same problem with the time() function. What is the proper syntax of the expression to get it to do what it says it will do?

Thanks
0 Kudos
Message 1 of 4
(8,807 Views)
You need to pass in a local variable that is a number to get each of these fields.  For example, you could call:

Date(false, Locals.Year, Locals.Month, Locals.MonthDay, Locals.Weekday),

Allen P
NI
0 Kudos
Message 2 of 4
(8,803 Views)

Boy, can you make the nomeclature any worse? And also, it would be very nice to have an example in the text since you went through all the trouble to put the definition.

Message 3 of 4
(7,821 Views)

Badmanbojambo,

 

Please do not bump old threads unless the topic needs to be revisited for a specific reason. 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 4
(7,797 Views)