Skip to content

Instantly share code, notes, and snippets.

@pj8912
Created January 9, 2024 09:42
Show Gist options
  • Save pj8912/74866e03927bc75b1fdb983c5b8737bb to your computer and use it in GitHub Desktop.
Save pj8912/74866e03927bc75b1fdb983c5b8737bb to your computer and use it in GitHub Desktop.
Current Timestamp created using python in sql format for current_timestamp
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