Variables

Variables

Variables (opens in a new tab) Store and Use variebles (opens in a new tab)

  
    // Pre-request Script
    // Usage in Params (Value) {{dateToday}}
    const today = new Date();
 
    const year = today.getFullYear();
    const month = (today.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based
    const day = today.getDate().toString().padStart(2, '0');
 
    const formattedDate = `${year}-${month}-${day}`;
    const dateToday = pm.globals.set('dateToday',formattedDate)