Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 798 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 798 Bytes

Normal code fence as usual

test

import datetime

# Get current date and time
current_datetime = datetime.datetime.now()

# Format as strings
current_time = current_datetime.strftime("%H:%M:%S")  # 24-hour format
current_date = current_datetime.strftime("%Y-%m-%d")  # Year-Month-Day format
current_datetime_str = current_datetime.strftime("%Y-%m-%d %H:%M:%S")  # Year-Month-Day Hour:Minute:Second format

# Print the results
print("Current time (24-hour format):", current_time)
print("Current date:", current_date)
print("Current date and time:", current_datetime_str)

Run

1111
222

Run

Run

链接