我正在尝试将我的日期时间转换为unix时间戳。我尝试了几种方法,但错误完全相同。我不太确定我想做什么。
date_joined
就像这个2017-09-30 10:24:44.954981+00:00
function unix_timestamp(timestamp with time zone) does not exist
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
User.objects.annotate(photo_time=Func(F('date_joined'),function='UNIX_TIMESTAMP'))
User.objects.extra(select={'photo_time':"to_unixtime(date_joined)"})
#also tried and UNIX_TIMESTAMP