getUTCHours function

HI Team,

i have a date that is obtained from Mongo DB, the date that i extracted gives me the date in following format… which is deviating from the actual result -
2024-04-30T11:30:31.027Z

in C# i found getUTCHours function, is there are similar function in python as well

The “Z” without an offset means that that is UTC.

Is that a string object or a date object?
If it is a string you can parse it into a python datetime object and use its methods.

i have exported results from one data source and the results are in Excel, i believe it should be a string.

Ok so use datetime module to process the date and time information: datetime — Basic date and time types — Python 3.12.3 documentation
You will want to read up on timezones in that page.