Data cleansing Note: sorts strings to dates (A Date Field is processed in multiple formats ),
Original Works are from the blog of "Deep Blue blog". You are welcome to repost them. You must specify the source when you repost them. Otherwise, you have the right to pursue legal liability for copyright.
Deep Blue blog: http://blog.csdn.net/huangyanlong/article/details/46513855
Background]
When cleaning data, it is found that there are three types of data
Addition and subtraction of dates in js
JavaScript code example for date addition and subtraction. Because JavaScript does not have the AddDays method similar to C #, you need to write a function to implement date addition and subtraction.
Today, let's make a summary of the date addition and subtraction in JS. There are two steps in total.
Step 1: Introduce date. format. js. The function of this JS is to convert the date to the specified format. The C
Red Hat Enterprise Linux versions and release dates
Red Hat Enterprise Linux 7
Release/Update
General Availability Date
Redhat-release Errata Date *
Kernel Version
RHEL 7 Update 2
DNT
DNT
DNT
RHEL 7 Update 1
2015-03-05
RHEA-2015: 0524
3.10.0-229
RHEL 7 GA
2014-06-09
-
3.10.0-123
RHEL 7 RC
2014-04-23
-
3.10.0-121
I recently encountered a problem that requires the number of working days between two dates. I found the js Code on the Internet and referred to other people's code. I found that all the code was redundant. So I thought about it myself, after a simple process. It is mainly simplified in loop processing.
The cycle of the remaining days can also be considered as processing between the start date and the remaining days, the number of Saturday and Sunday
MySql functions for determining Chinese characters, dates, and numbers, and mysql Chinese Characters
Several commonMysql Functions
/*************************************** **************1. Determine whether the string is returned from Chinese characters: 1-0-non-Chinese Characters
**************************************** *************/
Drop function if exists fc_is_hanzi;
Create function fc_is_hanzi (P_str VARCHAR (1024))RETURNS int (11)NOT DETERMINIS
Set @ mycnt = 0;Select date_add ("2008-07-31", interval @ mycnt: = @ mycnt + 1 day) as day from t_prehandle_qeesoo_04 limit 31
The preceding SQL statement lists all the dates of January.
In the preceding SQL statement, refers to the start date and limit 31 refers to the addition of 31 days.
T_prehandle_qeesoo_04 is a random table, as long as the table has more than 31 rows of data.
Result:Day2008-08-012008-08-022008-08-032008-08-042008-08-052008-0
[Switch] JAVA gets the difference between the connected dates, java gets the date
Public class Test2 {
Public long getTwoDay (Date begin_date, Date end_date ){Long day = 0;Try {SimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd ");String sdate = format. format (Calendar. getInstance (). getTime ());If (begin_date = null ){Begin_date = format. parse (sdate );}If (end_date = null ){End_date = format. parse (sdate );}Day = (end_date.getTime ()-b
Compare the number of different days between two dates, such as the number of months and the number of days
// Compare the selected Start Time and End Time
+ (BOOL) ComparisonString :( NSString *) str1 andString :( NSString *) str2
{
// NSString * dateStr = @ "01:01:01"; // input time
// 1. Obtain the time
NSDate * senddate = [NSDate date];
NSDateFormatter * dateformatter = [[NSDateFormatter alloc] init];
[Dateformatter setDateFormat: @ "yyyy-MM-dd"
I saw a post today. I used the isdate function to return 0 for a date before December 31, 1753, and I did multiple tests. I found that:
Declare @ date asdate
Set @ date = convert (date, '20140901 ')
Print @ date -- can be converted to the date type
Print isdate ('20140901 ')
The result returns 0:
1700-01-010
Later, someone mentioned the storage range that may be related to the SQL Server date. They checked the msdn and found that:
Datetim date range:
Date range
January 1-9,
I have a field timestamp in the mysql database. how can I query the data between different dates? mysql has a field Reg_addtime, which is the time value saved in the timestamp mode.
How can I query, for example, the list of registered members from January 1, May 1, 2013 to January 1, May 10, 2013.
I am not satisfied with a small dish. half a bottle is full. Give me some advice.
Reply to discussion (solution)
SELECT * FROM tbl_name WHERE FR
(); Take the upper limit2, Math.floor (); Lower limit3, math.sqrt (); Open Square4, Math.Round (); Rounded5, Math.random (); Random number, between 0-1.Iv. EventsOnClick Mouse Single TriggerOnDblClick Mouse double-click Triggeronmouseover Mouse Move-in triggeronmouseout Mouse move out TriggerOnMouseMove Mouse on top move triggeronchange content Change Triggeronblur Loss of Focus trigger (focus refers to the cursor position)Onfocus Get intersection TriggerOnKeyDown Press the button to triggeronk
in one development, because birthdays in a database are of datetime data type, the data format in the database is: 2017-07-11 00:00:00. However, in the edit page, the echo birthday must not be displayed for a minute or minute, only the 2017-07-11 format can be displayed, and if not processed, the echo data is problematic. without changing the structure of the database, we format the echo data directly in the JSP page, usingfmt:formatdate/> label. The code is as follows:
value=" value
]; //yyyy mm month dd Day HH24 hours HH12 hours mm minutes ss seconds mmmm month[dateformatter setdateformat:@ "Yyyy-mm-dd HH:mm:ss MMMM"]; //date turn into timensstring *datastring = [dateformatter stringfromdate:d ate];return datastring;}#pragma mark to format a string of time datastr for the specified time zone-(nsstring *) Timezonetimeformat: (nsstring *) datastr{ nsdateformatter *dateformatter = [[nsdateformatter alloc] init];[Dateformatter Setdateformat:@ "Yyyy-mm-dd hh:mm"];nsdate *date
COleDateTime A;CString B = _t ("2012-12-24 15:30:48"); bool F = a.parsedatetime (b,locale_nouseroverride);//string to date int c = A.gethour ();//Fetch time//Get system current time, and turn to string coledateTime Datetest;Datetest = Coledatetime::getcurrenttime ();CString F; F.format (_t ("%d"), Datetest.getyear ());//the string CString g = Datetest.format (_t ("%y-%m-%d%h:%m:%s") for year//current time);MFC dates and strings are converted to each o
month/day/year and other cultural formats that browsers can access, the server is not necessarily.
If that's not enough, there's a bigger advantage to the new pie, and someone else has done it for us (Moment.js is coming)!
Moment.js Introduction
Moment.js is a small, free, open source JavaScript library that promotes dates and events to another level. It provides all the time and date formats imaginable, and here are some.
To use Moment.js in our
A recent project on the timeline, giving a start time and an end time, you need to list the dates in this time period and also determine how many weeks. After research, come up with the following methods, and we share, to facilitate the need for friends.
First, the effect of this demand map:
The code is as follows
Copy Code
/** Parameters are start time stamp, end timestamp*/function Timelist ($beginTimeStamp, $endTimeSt
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.