Created
January 9, 2024 09:42
-
-
Save pj8912/74866e03927bc75b1fdb983c5b8737bb to your computer and use it in GitHub Desktop.
Current Timestamp created using python in sql format for current_timestamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def now(): | |
format_string = "%Y-%m-%d %H:%M:%S" | |
current_datetime = datetime.now() | |
current_datetime_without_microseconds = current_datetime.replace(microsecond=0) | |
return current_datetime_without_microseconds | |
print(now()) #output example : 2024-01-09 09:05:06 | |
#sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment