Use Any Character for Space in MySQL TIMESTAMP

varun
Updated on 29-Jan-2020 06:49:22

140 Views

We can use the only character ‘T’ (in Capital form only) at the place of space between date and time part. It can be elucidated with the help of the following example −mysql> Select TIMESTAMP('2017-10-20T06:10:36'); +----------------------------------+ | TIMESTAMP('2017-10-20T06:10:36') | +----------------------------------+ | 2017-10-20 06:10:36              | +----------------------------------+ 1 row in set (0.00 sec)

MySQL Returns on Using Different Characters Between Date and Time Parts

usharani
Updated on 29-Jan-2020 06:48:45

88 Views

In that case, MySQL will return all zeros at the place of time along with correct date part. An example is as follows in which we used character ‘W’ at the place of ‘T’ or ‘Space’ between date and time part −mysql> Select TIMESTAMP('2017-10-20W06:10:36'); +----------------------------------+ | TIMESTAMP('2017-10-20W06:10:36') | +----------------------------------+ | 2017-10-20 00:00:00              | +----------------------------------+ 1 row in set, 1 warning (0.00 sec)

MySQL Interpretation of Number and String as Date

varma
Updated on 29-Jan-2020 06:48:06

262 Views

If a string or number, even without any delimiter, in the format of YYYYMMDDHHMMSS or YYMMDDHHMMSS is making sense as the date is provided then MySQL interpret that string as a valid date.Examples are given for valid as well as invalid dates −mysql> Select Timestamp(20171022040536); +---------------------------+ | Timestamp(20171022040536) | +---------------------------+ | 2017-10-22 04:05:36       | +---------------------------+ 1 row in set (0.00 sec) mysql> Select Timestamp('20171022040536'); +-----------------------------+ | Timestamp('20171022040536') | +-----------------------------+ | 2017-10-22 04:05:36         | +-----------------------------+ 1 row in set (0.00 sec) mysql> Select Timestamp('171022040536'); +---------------------------+ | Timestamp('171022040536') | +---------------------------+ | 2017-10-22 04:05:36   ... Read More

Digits Required for Date Value in MySQL

Sreemaha
Updated on 29-Jan-2020 06:43:57

152 Views

While considering the year as 4-digit value, minimum of 8 digits in a string or number is required for MySQL to specify it as a date value. In this case, if we also want to store microseconds then the value can be up to a maximum of 20 digits.mysql> Select TIMESTAMP('20171022040536.100000'); +-----------------------------------+ | TIMESTAMP('20171022040536100000') | +-----------------------------------+ | 2017-10-22 04:05:36.100000        | +-----------------------------------+ 1 row in set, 1 warning (0.00 sec)The query above is taking 20 digits string for TIMESTAMP value. Last 6 digits are for microseconds.mysql> Select TIMESTAMP(20171022); +---------------------+ | TIMESTAMP(20171022) | +---------------------+ | 2017-10-22 00:00:00 | +---------------------+ ... Read More

radialGradient HTML5 Tag

Lakshmi Srinivas
Updated on 29-Jan-2020 06:42:19

245 Views

The HTML5 tag is used to draw SVG Gradients. Yes, modern browsers support it.The following is the HTML5 version of an SVG example that would draw an ellipse using the tag and would use the tag to define an SVG radial gradient. Similar way you can use the tag to create SVG linear gradient.                    #svgelem{             position: relative;             left: 50%;             -webkit-transform: translateX(-40%);             -ms-transform: translateX(-40%);             transform: translateX(-40%);          }             SVG                     HTML5 SVG Gradient Ellipse                                                                              

Apply Gravity Between Objects in HTML5 Canvas

Nishtha Thakur
Updated on 29-Jan-2020 06:41:21

244 Views

To apply gravity between two or more object in Canvas:var distX = ob1.x - ob2.x, distY = ob1.y - ob2.y; var val = distX *distX + distY * distY; var r = Math.sqrt(val); var F = 50 / val; var rhat_x = distX / r; var rhat_y = distY / r; var Fx = F * rhat_x; var Fy = F * rhat_y; ob1.vx += -Fx; ob1.vy += -Fy; ob2.vx += Fx; ob2.vy += Fy;

Detect Area of a PNG That Is Not Transparent with HTML

Lakshmi Srinivas
Updated on 29-Jan-2020 06:40:56

519 Views

To detect an area of a PNG that is not transparent: You need to first get the buffer You need to get 32-bits reference of that buffer Scan 0 widths to find x1 edge Scan width 0 to find x2 edge Height to find the y1 edge Height 0 to find the y2 edge

Canvas Style Display Block Not Working in HTML5

karthikeya Boyini
Updated on 29-Jan-2020 06:40:33

280 Views

Change the setTimeout() to use a function reference. It works as the function available at the time the reference.The reference will be transferred to the timeout event callback rather than a string reference:window.setTimeout(startNow, 2000);Set it like the following:setTimeout(startNow, 1000); function startNow () {    alert(‘Working correctly!'); }

Use WHERE Condition in CTAS for Table Creation

Monica Mona
Updated on 29-Jan-2020 06:39:37

236 Views

As we know that we can copy the data and structure from an existing table by CTAS script. Use of WHERE clause is demonstrated in the example belowmysql> Create table EMP_BACKUP2 AS SELECT * from EMPLOYEE WHERE id = 300 AND Name = 'Mohan'; Query OK, 1 row affected (0.14 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> Select * from EMP_BACKUP2; +------+-------+ | Id   | Name  | +------+-------+ | 300  | Mohan | +------+-------+ 1 row in set (0.00 sec)In the example above, we have created a table named EMP_BACKUP1 from table ‘Employee’ with some conditions. MySQL creates the table with only one row based on those conditions.

Draw Lines with easelJS using Ticker in HTML

Samual Sam
Updated on 29-Jan-2020 06:39:08

358 Views

EaseLJS is a JavaScript library to make the HTML5 Canvas element easy. Use it for creating games, graphics, etc.To draw lines using Ticker method in HTML with easeLJS:var myLine = new createjs.Shape(); myLine.graphics.setStrokeStyle(4); myLine.graphics.beginStroke(color); myLine.graphics.moveTo(startX, startY); startY++; myLine.graphics.lineTo(startX, startY); myLine.graphics.endStroke();

Advertisements