Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Parse date without timezone javascript

let s = "2005-07-08T11:22:33+0000";
let d = new Date(Date.parse(s));

// this logs for me 
// "Fri Jul 08 2005 13:22:33 GMT+0200 (Central European Summer Time)" 
// and something else for you

console.log(d.toString()) 

// this logs
// Fri, 08 Jul 2005 11:22:33 GMT
// for everyone

console.log(d.toUTCString())
Comment

javascript parse date in current timezone

/*  @param {string} s - an ISO 8001 format date and time string
**                      with all components, e.g. 2015-11-24T19:40:00
**  @returns {Date} - Date instance from parsing the string. May be NaN.
*/
function parseISOLocal(s) {
  var b = s.split(/D/);
  return new Date(b[0], b[1]-1, b[2], b[3], b[4], b[5]);
}

document.write(parseISOLocal('2015-11-24T19:40:00'));
Comment

PREVIOUS NEXT
Code Example
Javascript :: is undefined false in javascript 
Javascript :: ng-pick-datetime 
Javascript :: explain the exclamation mark in js 
Javascript :: hello world in javascript 
Javascript :: cancel or abort axios request 
Javascript :: how to get keys from request headers in express 
Javascript :: antd tag 
Javascript :: redux update item in array 
Javascript :: submit form without redirection 
Javascript :: how-to-reset-a-form-using-jquery 
Javascript :: .fetch method 
Javascript :: how to write a javascript function 
Javascript :: import firebase auth react 
Javascript :: prependchild javascript 
Javascript :: handlebarsjs each first element 
Javascript :: javascript change input value jquery 
Javascript :: javascript if statement 
Javascript :: operators in js 
Javascript :: how to include script file in javascript with javascript 
Javascript :: fetch json data into array 
Javascript :: what are json files for 
Javascript :: validate email or phone js 
Javascript :: react native font awesome 
Javascript :: application pool angular 8 
Javascript :: javascript int to string 
Javascript :: move element onclick javascript 
Javascript :: dynamic button click in javascript 
Javascript :: or operator javascript 
Javascript :: open another page js 
Javascript :: js get each pair of values from an array of objects 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =