Introduction
ZappySys provides built-in helper functions that let you generate dynamic values directly in the URL without writing custom code. In this tutorial, you will learn how to use date functions and other helper functions when working with ODBC connections and REST APIs.
Prerequisites
- Download and install the ZappySys ODBC PowerPack
Understanding Dynamic Functions in URLs
ZappySys allows you to use dynamic expressions inside URLs using the following syntax:
<<expression,FUNCTION_NAME>>
These expressions are evaluated at runtime before the request is sent to the API.
This approach allows you to create flexible and reusable API connections that automatically adjust based on the current date, time, or other dynamic values.
Date Functions Reference
Basic Date Functions
Current date (today):
<<FUN_TODAY>>
Example output:
2026-05-07
Current date and time (now):
<<FUN_NOW>>
Example output:
2026-05-07 14:30:45
Relative Date Calculations
You can calculate dates relative to the current date or time.
Previous day:
<<today-1d,FUN_TO_DATE>>
Next 2 days:
<<today+2d,FUN_TO_DATE>>
Previous 7 days (one week ago):
<<today-7d,FUN_TO_DATE>>
Start of the current month:
<<monthstart,FUN_TO_DATE>>
Start of the current year:
<<yearstart,FUN_TO_DATE>>
One day before the start of the current month:
<<monthstart-1d,FUN_TO_DATE>>
Add 2 hours to the current time:
<<now+2h,FUN_TO_DATETIME>>
Date Formatting
You can specify custom output formats in your expressions.
Standard datetime format (YYYY-MM-DD HH:mm:ss):
<<yyyy-MM-dd HH:mm:ss,FUN_NOW>>
Date-only format (YYYY-MM-DD):
<<yyyy-MM-dd,FUN_TODAY>>
Time-only format (HH:mm:ss):
<<HH:mm:ss,FUN_NOW>>
Timezone Functions
You can also convert dates and times between local time and UTC.
UTC date:
<<yyyy-MM-dd,FUN_TO_UTC_DATE>>
UTC datetime:
<<yyyy-MM-dd HH:mm:ss,FUN_TO_UTC_DATETIME>>
Local date:
<<yyyy-MM-dd,FUN_TO_LOCAL_DATE>>
Local datetime:
<<yyyy-MM-dd HH:mm:ss,FUN_TO_LOCAL_DATETIME>>
Practical Examples
Example 1: Basic Date Filter in URL
Retrieve data using today’s date:
https://api.example.com/data?date=<<yyyy-MM-dd,FUN_TODAY>>
Example 2: Date Range Filter (Last 7 Days)
A common scenario for incremental data loading:
https://api.example.com/data?startDate=<<today-7d,FUN_TO_DATE>>&endDate=<<yyyy-MM-dd,FUN_TODAY>>
This request automatically retrieves data from the previous 7 days without requiring manual updates.
Example 3: Month-to-Date Report
Retrieve data starting from the beginning of the current month:
https://api.example.com/report?from=<<monthstart,FUN_TO_DATE>>&to=<<yyyy-MM-dd,FUN_TODAY>>
Example 4: Timestamp with UTC Conversion
Retrieve data using a UTC timestamp:
https://api.example.com/events?since=<<yyyy-MM-dd HH:mm:ss,FUN_TO_UTC_DATETIME>>
Conclusion
Dynamic functions in ZappySys ODBC PowerPack enable you to build flexible, powerful API integrations without writing custom code. Whether you need to generate dynamic dates, format timestamps, encode parameters, or handle timezone conversions, these helper functions simplify API integration and improve maintainability.
Explore our ODBC PowerPack for more information and download and install it to start building smarter, faster, and more scalable solutions.
References
Need Help?
If you encounter any issues or have specific questions about using dynamic functions in ZappySys ODBC PowerPack:
- Live Chat: Use the chat widget on our website (bottom-right corner)
- Email Support: support@zappysys.com
- Support Tickets: Visit the ZappySys Support Portal