VOOZH about

URL: https://www.geeksforgeeks.org/python/python-tweepy-getting-the-time-when-a-user-was-created/

⇱ Python Tweepy – Getting the time when a user was created - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python Tweepy – Getting the time when a user was created

Last Updated : 18 Jun, 2020
In this article we will see how we can get the time and date when a user created their Twitter account. The created_at attribute provides us with a datetime object denoting the exact time when the user account was created. Identifying the date when a user was created in the GUI : 👁 Image
In the above mentioned profile the user was created on July 2009.
In order to get the date and time when the user was created, we have to do the following :
  1. Identify the user ID or the screen name of the profile.
  2. Get the User object of the profile using the get_user() method with the user ID or the screen name.
  3. From this object, fetch the created_at attribute present in it.
Example 1: Consider the following profile : 👁 Image
We will use the user ID to fetch the user. The user ID of the above mentioned profile is 57741058. Output :
The user was created on : 2009-07-17 20:02:09
Example 2: Consider the following profile : 👁 Image
We will use the screen name to fetch the user. The screen name of the above mentioned profile is PracticeGfG.
Output :
The user was created on : 2016-01-23 12:03:47
Comment
Article Tags:
Article Tags: