Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

how to get date from Sun Dec 10 1995 00:00:00 GMT+0530 (India Standard Time)

function convert(str) {
  var date = new Date(str),
    mnth = ("0" + (date.getMonth() + 1)).slice(-2),
    day = ("0" + date.getDate()).slice(-2);
  return [date.getFullYear(), mnth, day].join("-");
}

console.log(convert("Thu Jun 09 2011 00:00:00 GMT+0530 (India Standard Time)"))
//-> "2011-06-08"
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Typescript :: Tailwin navbar structure 
Typescript :: vscode pass argument to registerCommand 
Typescript :: ex: javascript loop 
Typescript :: how to create instances of classes godot 
Typescript :: call reactdom.render with 2 arguments example 
Typescript :: keynote Invite multiple users to make edits to the same document: 
Typescript :: global hotkeys typescript react 
Typescript :: four basic components that information system consists of 
Typescript :: python Implement the function is_even(number) which gets an integer as input parameter and checks, if this input is even or not 
Typescript :: What are the components of the environment? Explain it along with the examples class 6 
Typescript :: pass generic type to arow function typescript 
Typescript :: Implement a function that counts the number of nodes in a circularly linked list 
Typescript :: typescript optional parameters 
Typescript :: typescript type casting 
Typescript :: testing with limited information 
Typescript :: sorting list of multiple in an ascending order 
Typescript :: server sent events httpclient java.net 
Typescript :: Count pets the types of pets in a columns 
Typescript :: typescript convert to javascript 
Typescript :: pull rewuests in local project 
Typescript :: typescript question mark 
Typescript :: embed python in html 
Typescript :: jquery tscroll up 
Typescript :: Coding Exercise: Double Time Modify this recursive program to correctly count down in increments of 2. 
Cpp :: how to disable buttons in unity 
Cpp :: select one random element of a vector in c++ 
Cpp :: c++ reverse vector 
Cpp :: clear file before writing c++ 
Cpp :: c++ try catch 
Cpp :: repeat character n times c++ 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =