Building on the get_moment() method, the simplified code below calculates the date and time without requiring the respondent to answer a date question.
Details
- The results returned by this method are in real time.
- Although built as a table in the example above, each component can be used as a standalone variable, as shown in the examples below.
- Unless using 'stringify' (DATE_STRING above), the variables can be built as either text or number types, depending on need.
Additional examples
Using as a 'type: date' question
This example uses the $_moment method to populate QNOW as a date question.
NOW. right now, as a date type: date dvalue: $_moment->now()
Using with 'trendable' for a tracker
In the following example, the QWAVE variable is setup as part of a monthly tracker using the trendable tag and the $_moment method,.
WAVE. Month of data collection
type: coded single select
selectby: calculate
trendable: y {desc: Monthly}
cvalue: $_moment->strftime("%y%m")
2508. 25-Aug
2509. 25-Sept
2510. 25-Oct
2511. 25-Nov
2512. 25-Dec
2601. 26-Jan
Comments
0 comments
Please sign in to leave a comment.