Return to Snippet

Revision: 80271
at February 29, 2020 10:29 by johnwalsh1


Updated Description
Always gives me perfect date.

Sample Output

Current Day is: 1
Current Month is: 2
Current Year is: 2020
Current Hour is: 17
Current Minute is: 3
Current Second is: 8
Current Microsecond is: 556483

Revision: 80270
at February 29, 2020 10:28 by johnwalsh1


Updated Description
Always gives me perfect date.

*Sample Output*

Current Day is: 1
Current Month is: 2
Current Year is: 2020
Current Hour is: 17
Current Minute is: 3
Current Second is: 8
Current Microsecond is: 556483

Revision: 80269
at February 29, 2020 10:28 by johnwalsh1


Updated Description
Always gives me perfect date.

## Sample Output

Current Day is: 1
Current Month is: 2
Current Year is: 2020
Current Hour is: 17
Current Minute is: 3
Current Second is: 8
Current Microsecond is: 556483

Revision: 80268
at February 29, 2020 10:27 by johnwalsh1


Updated URL
https://speedysense.com/get-current-date-time-python/

Updated Code
from datetime import datetime

now = datetime.now()
print("Current Day is:", now.day)
print("Current Month is:", now.month)
print("Current Year is:", now.year)
print("Current Hour is:", now.hour)
print("Current Minute is:", now.minute)
print("Current Second is:", now.second)
print("Current Microsecond is:", now.microsecond)

Updated Description
Always gives me perfect date.

Output

Current Day is: 1
Current Month is: 2
Current Year is: 2020
Current Hour is: 17
Current Minute is: 3
Current Second is: 8
Current Microsecond is: 556483

Revision: 80267
at February 29, 2020 10:26 by johnwalsh1


Updated Code
from datetime import datetime

now = datetime.now()
print("Current Day is:", now.day)
print("Current Month is:", now.month)
print("Current Year is:", now.year)
print("Current Hour is:", now.hour)
print("Current Minute is:", now.minute)
print("Current Second is:", now.second)
print("Current Microsecond is:", now.microsecond)

Source: https://speedysense.com/get-current-date-time-python/

Updated Description
Always gives me perfect date. Output

Current Day is: 1
Current Month is: 2
Current Year is: 2020
Current Hour is: 17
Current Minute is: 3
Current Second is: 8
Current Microsecond is: 556483

Revision: 80266
at February 29, 2020 10:25 by johnwalsh1


Updated Description
Always gives me fits.

Source: https://speedysense.com/get-current-date-time-python/

Revision: 80265
at February 29, 2020 10:23 by johnwalsh1


Updated Description
Always gives me fits.

Source: [https://speedysense.com/get-current-date-time-python/](https://speedysense.com/get-current-date-time-python/)

Revision: 80264
at February 29, 2020 10:22 by johnwalsh1


Updated Code
from datetime import datetime

now = datetime.now()
print("Current Day is:", now.day)
print("Current Month is:", now.month)
print("Current Year is:", now.year)
print("Current Hour is:", now.hour)
print("Current Minute is:", now.minute)
print("Current Second is:", now.second)
print("Current Microsecond is:", now.microsecond)

Updated Description
Always gives me fits.

Source https://speedysense.com/get-current-date-time-python/

Revision: 80263
at February 29, 2020 10:22 by johnwalsh1


Initial Title
Get current date and time in Python

Initial Description
Always gives me fits.

<pre><code>from datetime import datetime

now = datetime.now()
print("Current Day is:", now.day)
print("Current Month is:", now.month)
print("Current Year is:", now.year)
print("Current Hour is:", now.hour)
print("Current Minute is:", now.minute)
print("Current Second is:", now.second)
print("Current Microsecond is:", now.microsecond)
</code></pre>

Initial Code
https://speedysense.com/get-current-date-time-python/

Initial Tags
date, python

Initial Language
Python

Initial URL