Skip to content

Catch the current datetime from my country #661

Answered by jshcodes
brucelourenco asked this question in Q&A
Discussion options

You must be logged in to vote

Hu @brucelourenco -

There are a few ways to solve this problem, for this scenario I went with a couple of imports. (python-dateutil, pytz)

Side note: I guessed at your timezone. You can get a complete list from pytz.all_timezones_set.

from datetime import datetime
from falconpy import Detects
import pytz
from dateutil import parser

# Connect to the API
detects = Detects(client_id="FALCON_CLIENT_ID", client_secret="FALCON_CLIENT_SECRET")
# Retrieve a list of detection IDs
# Note: This example is lazy, you should confirm status_code, etc. before proceeding.
detect_ids = detects.query_detects()["body"]["resources"]
# Retrieve our detection summaries - same holds true here
summaries = detects

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brucelourenco
Comment options

Answer selected by brucelourenco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
detects Detections issues and questions SDK usage General SDK usage issues and questions
2 participants