Methods
date.get_hours()
Retrieve the hour component from zero to twenty three for the current date instance.
The get_hours method returns the hour of the day as an integer between 0 and 23 for the current NepaliDate instance. It reflects local time coordinates stored within the instance timestamp.
Import
from nepali_date_library import NepaliDateSignature
def get_hours(self) -> int:Parameters
- None.
Return Value
- Type:
int - Range:
0to23 - Description: Hour integer representing time of day.
Example
from nepali_date_library import NepaliDate
now = NepaliDate()
print(f"Current hour: {now.get_hours()}")Related
date.get_minutes(): Retrieve the minute component.date.get_seconds(): Retrieve the second component.
Advertisement
date.get_day()
Retrieve the numeric day of the week index from zero for Sunday through six for Saturday.
date.get_minutes()
Retrieve the minute component from zero to fifty nine for the current date instance.