The Pandas Timestamp function utcnow() used to create Timestamp object that represents the UTC day and time. It returns a Timestamp with UTC date time.
1 classmethod Timestamp.utcnow()
1 import pandas as pd
2
3 res = pd.Timestamp.utcnow()
4 print('The UTC timestamp object :')
5 print(res)
In the above example, a Timestamp object is created by calling utcnow() function that returns Timestamp object that represents the UTC day and time. The result is assign to the variable that will be printed on console.
1 The UTC timestamp object :
2 2022-08-15 09:41:46.218790+00:00
Example 2
1 import pandas as pd
2
3 res = pd.Timestamp.utcnow()
4 print('The UTC timestamp object :')
5 print(res)
In the above example, a Timestamp object is created by calling utcnow() function that returns Timestamp object that represents the UTC day and time. The result is assign to the variable that will be print.
1 The UTC timestamp object :
2 2023-03-28 15:15:00.872003+00:00
Related options for your search