Last active
August 22, 2023 22:49
-
-
Save aquaductape/1eb46dfbaf6c9879b19a8e4b38c58d2e to your computer and use it in GitHub Desktop.
how to get produce timestamp like rails
This file contains 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
# how to get produce timestamp like rails | |
# | |
# ActiveRecord::Schema[7.0].define(version: 2023_03_19_164906) do | |
# create_table "articles", force: :cascade do |t| | |
# t.datetime "created_at", null: false | |
# t.datetime "updated_at", null: false | |
# end | |
# end | |
# `%6N` is microsecond ( 6 digits ) | |
p Time.now.strftime("%Y-%m-%d %H:%M:%S.%6N") | |
# "2023-03-28 00:04:10.054370" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment