go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

using datetime field under the model: Unable to query anything

Open daifuyang opened this issue 2 years ago • 2 comments

Describe the bug How to use a datetime field under the 'model'? I can't query anything. Can you help me?

To Reproduce select id,name,voice,desc,sample_rate_hertz,voice_type,words_per_minute,gender,status,created_at,updated_at,deleted_at from voice where deleted_at = ?

? = 0

has no data

select id,name,voice,desc,sample_rate_hertz,voice_type,words_per_minute,gender,status,created_at,updated_at,deleted_at from voice where deleted_at = 0 has data list

Expected behavior

Screenshots image

Environments (please complete the following information):

  • OS: [e.g. macos]
  • go-zero version [e.g. 1.5.5]
  • goctl version [e.g. 1.5.5]

daifuyang avatar Sep 08 '23 06:09 daifuyang

Add “parseTime=True“ in the end of mysql connection string. For example, "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local".

klen-ygs avatar Sep 26 '23 12:09 klen-ygs

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 28 '24 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 30 '24 02:12 github-actions[bot]