getMovDate()

The getMovDate() function (server-side) retrieves a date and time value from a question and answer combination. You can also adjust the date by adding or subtracting a specific number of days.

Syntax

Use these syntax formats for the getMovDate() function:

  • To retrieve date and time in synchronous mode:

                    getMovDate('QUESTION_CODE', 'ANSWER_CODE', daysNumber, {
        async: false
    }); 
    
                  
                    getMovDate('QUESTION_CODE', 'ANSWER_CODE', daysNumber); 
    
                  
  • To retrieve date and time in asynchronous mode:

                    getMovDate('QUESTION_CODE', 'ANSWER_CODE', daysNumber, {
        async: true
    }).done(callback); 
    
                  

Return Value

The getMovDate() function returns a string formatted as date and time data.

Parameters

Note:

Required parameters:

  • QUESTION_CODE

  • ANSWER_CODE

  • daysNumber

The getMovDate() function accepts the following parameters:

  • QUESTION_CODE (string) - Specifies the question code. You can find it in the Code field on the question record.

  • ANSWER_CODE (string) - Specifies the answer code. You can find it in the Code field on the answer record.

  • daysNumber (number) - Specifies the amount of days to add or subtract.

  • mode (object) - Specifies the synchronous or asynchronous processing mode using the async property. This property is false by default. So getMoveDate() runs synchronously by default.

Examples

The following examples show how to use the getMovDate() function.

Retrieving the Current Date

Assuming today is March 25, 2026, this example retrieves the current date from the INPUT_BOX/DATE question and answer combination.

              const date = getMovDate('INPUT_BOX', 'DATE', 0);
console.log(date); 

            

See the output:

              3/25/2026 12:00 am 

            

Retrieving Tomorrow's Date

Assuming today is March 25, 2026, this example retrieves tomorrow's date from the INPUT_BOX/DATE question and answer combination.

              const date = getMovDate('INPUT_BOX', 'DATE', 1);
console.log(date); 

            

See the output:

              3/26/2026 12:00 am 

            

Retrieving Yesterday's Date

Assuming today is March 25, 2026, this example retrieves yesterday's date from the INPUT_BOX/DATE question and answer combination.

              const date = getMovDate('INPUT_BOX', 'DATE', -1);
console.log(date); 

            

See the output:

              3/24/2026 12:00 am 

            

Retrieving the Current Date Asynchronously

Assuming today is March 25, 2026, this example retrieves the current date from the INPUT_BOX/DATE question and answer combination in asynchronous mode.

              getMovDate('INPUT_BOX', 'DATE', 0, {
    async: true
}).done(function(date) {
    console.log(date);
}); 

            

See the output:

              3/25/2026 12:00 am 

            

Related Topics

General Notices