iOS is often used to show code snippets a few hours ago/days ago/months ago/years ago2015-03-13 10:09copyright Notice: Please pay attention to personal blog: http://www.henishuo.com/print?
/**
* Retain a formated string with a real date
MYSQL queries data today, yesterday, 7 days ago, 30 days, and this month, mysql days ago
Today:
SELECT * FROM table name WHERE TO_DAYS (time field name) = TO_DAYS (NOW ());
Yesterday:
SELECT * FROM table name WHERE TO_DAYS (NOW ()-TO_DAYS (time
Today:SELECT * FROM table name WHERE to_days (Time field name) = To_days (now ());Yesterday:SELECT * FROM table name WHERE to_days (now ())-To_days (Time field name) 7 days ago:SELECT * FROM table name where Date_sub (Curdate (), INTERVAL 7 day) 30
Do not need to keep so much, according to company requirements only need to retain one weeks.1. What is the way to automatically delete the *.log files that were backed up 7 days ago?2. Too many servers, it is not possible to create one by one
Timestamp is a small feature that we often use in comparison of time and date, next, I will introduce some methods for converting the strtotime Timestamp and use it to format a date several minutes, several hours ago, or several days ago. Timestamp
Background:The items that are built daily are placed in different folders by date. As today's construction is put into 2015-06-01, tomorrow's will be put into 2015-06-02, and so on. Long time, need a script to delete the folder N days ago. (In this
This article is generated in the writing of personal site backup script when you see, stay for referenceProblem scenario: Because my company has too many servers, the daily backup log files that I've created accumulate over the long haul. And do not
For example, I have a Sqlite3 type database created with SQLite Studio, and a table structure with table name Statisticsdata is:--table: StatisticsdataCREATE TABLE"Statisticsdata" ("Id" )TEXT not NULL, "MachineName"NVARCHAR, "SessionId"INTEGER,
Due to the large number of servers in the company, the daily backup log files created previously accumulate over time.Very large.
And there is no need to keep that much, according to the company's requirements only need to keep a week.
1. Is there
JAVA to seek yesterday, tomorrow's algorithm (two days ago, after three days to seek the law)
The Java time class is supported by pointing to a day earlier or later, in this way, we bring great convenience to the development of the program. For
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.