当前位置:网站首页>JS intercepts the first few digits of the string or the last few digits of the string
JS intercepts the first few digits of the string or the last few digits of the string
2022-07-19 01:30:00 【Pengzai studio】
The time when you often encounter backstage reaction is ‘2020-02-02 10:00:00’, The page needs to display only the year, month and day or only the hour, minute and second , The simplest way is to intercept the returned value directly .

How to intercept the first few , The case is as follows
var date = '1996-10-22 22:55:33';
var key = date.substring(0,10);
console.log(key);
// Print the results :1996-10-22How to intercept the last few bits , The case is as follows
var date = '1996-10-22 22:55:33';
var dateLength = disName.length;
var key = disName.substring(dateLength-8,dateLength);
console.log(key);
// Print the results :22:55:33summary :
substring(a,b);
a It means starting from the number of ,
b Indicates the end of the order ,
Understood from a Intercept to b .
Look at the address :js How to intercept the first few digits of a string ?js How to intercept the last few bits of a string ? The time when you often encounter backstage reaction is ‘2020-02-0210:00:00’, The page needs to display only the year, month and day or only the hour, minute and second , The simplest way is to intercept the returned value directly . How to intercept the first few , The case is as follows var date =..., Share blog
http://sharedbk.com/post/236.html

边栏推荐
- Oracle automatic storage management 18C step-by-step installation -1
- JSX syntax
- VsCode建立非工程目录下的头文件自动查找
- Oracle database startup and shutdown steps
- Collection and summary of penetration test information
- Day06-ORM字段及操作
- Supplementary knowledge of attributes and methods of regular, JWT token, ronglianyun, celery, channel group, SKU, SPU, request object
- “我的”Bug大全(转载)
- The C Programming Language 2nd --笔记--6.7
- JSX 语法
猜你喜欢
随机推荐
object-fit:cover;在小程序中不起作用,小程序图片变形了如何处理
C Programming Language(2nd Edition)--读书笔记--1.5.1
uni-app微信公众号(4)——地址管理页面
小程序swiper高度
深度之眼三——(6)】数学:矩阵对角化及二次型1
Eye of depth III - (7, 8)] mathematics: matrix diagonalization and quadratic form 2.3
智能指针(shared_ptr、unique_ptr、weak_ptr)
页面布局——三栏布局解决方式
关于外键的引用,跨域头部,ref的用法
电商后台管理登录
Cve-2022-34265 Django extract & TRUNC SQL injection vulnerability recurrence
P6-day01-通用试图(P4复习)
es6 map提取数组对象
时间戳转化时间
jsx 编译
[GFCTF 2021]Baby_ Cve-2021-41773 on the web
Win10 vscode 代码格式化设置与远程断点调试
day11-序列化器
Codeforces round #664C
The C Programming Language (2nd)--笔记--1.8





![Stack injection [strong net cup 2019] random note](/img/94/9069ed79e994e3c2e96c3cd1f816ee.png)



