Home Web Front-end JS Tutorial Detailed explanation of the use of date-related functions in JS

Detailed explanation of the use of date-related functions in JS

Mar 26, 2018 am 09:28 AM
javascript use Detailed explanation

This time I will bring you JS date-related functions Detailed explanation of usage, precautions when using JS date-related functions, the following is a practical case, let’s take a look.

1. Date related Function

select current_date();
select current_date;
select current_time;
select current_timestamp;
select date_add (current_timestamp(), interval 1 year);
select date_add (current_timestamp(), interval 1 month);
select date_sub (current_timestamp(), interval 1 year);
select date_sub (current_timestamp(), interval 1 month);
select datediff(current_timestamp(), date_add (current_timestamp(), interval 1 month );
select timediff('12:30:30', '18:30:30');
select now();select year(now());
select month(now());
Copy after login

2.Process controlFunction

IF (expr1,expr2,expr3);
select if (1 > 0, 'hello','see you');
IFNULL (expr1,expr2);select ifnull (null, 3 + 2);
SELECT CASE WHEN expr1 then expr2 else expr3 end;
select case when 10> 0;
Copy after login

3.Other functions

USER();
DATABASE();
MD5(str) ;
PASSWORD(str );
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Laravel implements multi-user authentication system

PHP data security method to prevent SQL injection


The above is the detailed content of Detailed explanation of the use of date-related functions in JS. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What software is crystaldiskmark? -How to use crystaldiskmark? What software is crystaldiskmark? -How to use crystaldiskmark? Mar 18, 2024 pm 02:58 PM

What software is crystaldiskmark? -How to use crystaldiskmark?

Detailed explanation of obtaining administrator rights in Win11 Detailed explanation of obtaining administrator rights in Win11 Mar 08, 2024 pm 03:06 PM

Detailed explanation of obtaining administrator rights in Win11

How to download foobar2000? -How to use foobar2000 How to download foobar2000? -How to use foobar2000 Mar 18, 2024 am 10:58 AM

How to download foobar2000? -How to use foobar2000

How to use NetEase Mailbox Master How to use NetEase Mailbox Master Mar 27, 2024 pm 05:32 PM

How to use NetEase Mailbox Master

How to use Baidu Netdisk app How to use Baidu Netdisk app Mar 27, 2024 pm 06:46 PM

How to use Baidu Netdisk app

Detailed explanation of division operation in Oracle SQL Detailed explanation of division operation in Oracle SQL Mar 10, 2024 am 09:51 AM

Detailed explanation of division operation in Oracle SQL

BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange? BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange? Apr 26, 2024 am 09:40 AM

BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange?

Teach you how to use the new advanced features of iOS 17.4 'Stolen Device Protection' Teach you how to use the new advanced features of iOS 17.4 'Stolen Device Protection' Mar 10, 2024 pm 04:34 PM

Teach you how to use the new advanced features of iOS 17.4 'Stolen Device Protection'

See all articles