Skip to content

Commit 70ff41c

Browse files
author
nianiB9
committed
Update cursorDate to calculate date from 1 year ago
1 parent f5fe986 commit 70ff41c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/monitor/examples/eg001_get_monitoring_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from docusign_monitor import DataSetApi
22
from flask import session
3+
from datetime import datetime, timedelta, timezone
34

45
from app.monitor.utils import create_monitor_api_client
56

@@ -25,9 +26,10 @@ def worker(args):
2526
)
2627
#ds-snippet-end:Monitor1Step2
2728
#ds-snippet-start:Monitor1Step3
29+
cursor_date = datetime.now(timezone.utc).replace(year=datetime.now(timezone.utc).year - 1)
2830
dataset_api = DataSetApi(api_client=api_client)
2931

30-
cursor_value = ''
32+
cursor_value = cursor_date.strftime('%Y-%m-%dT00:00:00Z')
3133
limit = 2000
3234
function_results = []
3335
complete = False

0 commit comments

Comments
 (0)