MySQL gets yesterday data UTC time

Source: Internet
Author: User
# YZJ invited yesterday data select S.id, S.create_at, Ch.id, Ch.code as channel, C.id, C.code as Custom, So.id, So.code as Sourcefrom Invit E_ship sleft join Invite_channel ch on ch.id = S.invite_channel_idleft join Invite_code_custom c on c.id = S.code_custom_i Dleft JOIN invite_source so on s.invite_source_id = So.idwhere s.invite_source_id! = 0AND s.create_at > date_sub (date_s UB (Curdate (), INTERVAL 1 day), INTERVAL 8 HOUR) and S.create_at < Date_sub (Curdate (), INTERVAL 8 HOUR) ORDER by S.id DESC

Here S.create_at is the Time field, and if you have a UTC time in your library, this SQL logic is the right one.

MySQL gets yesterday data UTC time

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.