这是一个模型博客。
我想将模型的created_at和updated_at转换为Google Protobuf时间戳。
如何在组成protobuf消息时将DateTime转换为Google Protobuf TimeStamp?
如何在组成protobuf消息时将DateTime转换为Google Protobuf TimeStamp?
# id :bigint(8)
# created_at :datetime not null
# updated_at :datetime not null
class Blog < ApplicationRecord
end
我想将模型的created_at和updated_at转换为Google Protobuf时间戳。
blog = Blog.first
blog.created_at
如何在组成protobuf消息时将DateTime转换为Google Protobuf TimeStamp?
如何在组成protobuf消息时将DateTime转换为Google Protobuf TimeStamp?