Skip to content

Instantly share code, notes, and snippets.

@EngPeterShaker
Last active June 11, 2018 09:14
Show Gist options
  • Save EngPeterShaker/529f57935eed7c0f723770961f41b4a7 to your computer and use it in GitHub Desktop.
Save EngPeterShaker/529f57935eed7c0f723770961f41b4a7 to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/dodivog
var x = moment().utc().format();
/* var now = moment().hours;
console.log(now.hours(x)); */
// var sendDateTime = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
//var timeAndDate = moment(moment().date()+' '+sendtime);
var sendtime = "13:23";
var sendDateTime2 = (moment().format('YY-MM-DD') + ' ' +sendtime);
var yty = moment.utc("2015-10-01 01:24:21").utcOffset(+"-240").format('YYYYMMDD HH:mm:ss ZZ')
console.log("x" , x)
var koko = moment().format('YYYY-MM-DDT' + sendtime +':00Z');
var lolo = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
var mokoko = moment(koko);
var mololo= moment(lolo);
console.log(mokoko);
//console.log(mololo)
var StartDate = moment(StartDate).format('YY-MM-DD');
console.log("StartDate" , StartDate)
var date = moment( sendtime, "HH:mm:ss")
.add(moment().zone(), 'minutes')
.format('LTS');
var sendDateTime = moment(moment().format('YYYY-MM-DD') + ' ' +date);
console.log("date", sendDateTime)
var newr = moment(date);
console.log("newr", newr);
//sms manager
var result = new Date(sendDateTime) - new Date().getTime();
console.log(result)
document.getElementById("demo").innerHTML =
"The value of z is: " + koko + "------" + '\n'+ lolo ;
var date = moment( sendtime, "HH:mm:ss")
.add(moment().zone(), 'minutes')
.format('LTS');
var sendDateTime = moment(moment().format('YYYY-MM-DD ') + moment( sendtime, "HH:mm")
.add(moment().zone(), 'minutes')
.format('LTS'));
var result = new Date(sendDateTime) - new Date().getTime();
console.log("----")
console.log(result)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<p id="demo"></p>
<script src="https://cdn.jsdelivr.net/momentjs/2.14.1/moment-with-locales.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/2.14.1/locales.min.js"></script>
<script id="jsbin-javascript">
var x = moment().utc().format();
/* var now = moment().hours;
console.log(now.hours(x)); */
// var sendDateTime = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
//var timeAndDate = moment(moment().date()+' '+sendtime);
var sendtime = "13:23";
var sendDateTime2 = (moment().format('YY-MM-DD') + ' ' +sendtime);
var yty = moment.utc("2015-10-01 01:24:21").utcOffset(+"-240").format('YYYYMMDD HH:mm:ss ZZ')
/* console.log("yytyytyty" , yty)
console.log(sendDateTime2);
console.log("lllll",moment().add(moment().zone(), 'm')) */
//var hitham2 = sendDateTime2.add(moment().zone(), 'mm') ;
//var hitham = moment(sendDateTime2).zone(100);
//console.log("--hitham--" , hitham)
console.log("yty" , yty)
console.log("x" , x)
var koko = moment().format('YYYY-MM-DDT' + sendtime +':00Z');
var lolo = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
var mokoko = moment(koko);
var mololo= moment(lolo);
console.log(mokoko);
//console.log(mololo)
var StartDate = moment(StartDate).format('YY-MM-DD');
console.log("StartDate" , StartDate)
var date = moment( sendtime, "HH:mm:ss")
.add(moment().zone(), 'minutes')
.format('LTS');
var sendDateTime = moment(moment().format('YYYY-MM-DD') + ' ' +date);
console.log("date", sendDateTime)
var newr = moment(date);
console.log("newr", newr);
//sms manager
var result = new Date(sendDateTime) - new Date().getTime();
console.log(result)
document.getElementById("demo").innerHTML =
"The value of z is: " + koko + "------" + '\n'+ lolo ;
var date = moment( sendtime, "HH:mm:ss")
.add(moment().zone(), 'minutes')
.format('LTS');
var sendDateTime = moment(moment().format('YYYY-MM-DD ') + moment( sendtime, "HH:mm")
.add(moment().zone(), 'minutes')
.format('LTS'));
var result = new Date(sendDateTime) - new Date().getTime();
console.log("----")
console.log(result)
</script>
<script id="jsbin-source-javascript" type="text/javascript">var x = moment().utc().format();
/* var now = moment().hours;
console.log(now.hours(x)); */
// var sendDateTime = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
//var timeAndDate = moment(moment().date()+' '+sendtime);
var sendtime = "13:23";
var sendDateTime2 = (moment().format('YY-MM-DD') + ' ' +sendtime);
var yty = moment.utc("2015-10-01 01:24:21").utcOffset(+"-240").format('YYYYMMDD HH:mm:ss ZZ')
/* console.log("yytyytyty" , yty)
console.log(sendDateTime2);
console.log("lllll",moment().add(moment().zone(), 'm')) */
//var hitham2 = sendDateTime2.add(moment().zone(), 'mm') ;
//var hitham = moment(sendDateTime2).zone(100);
//console.log("--hitham--" , hitham)
console.log("yty" , yty)
console.log("x" , x)
var koko = moment().format('YYYY-MM-DDT' + sendtime +':00Z');
var lolo = moment().format('YYYY-MM-DD')+'T' + sendtime+':00Z';
var mokoko = moment(koko);
var mololo= moment(lolo);
console.log(mokoko);
//console.log(mololo)
var StartDate = moment(StartDate).format('YY-MM-DD');
console.log("StartDate" , StartDate)
var date = moment( sendtime, "HH:mm:ss")
.add(moment().zone(), 'minutes')
.format('LTS');
var sendDateTime = moment(moment().format('YYYY-MM-DD') + ' ' +date);
console.log("date", sendDateTime)
var newr = moment(date);
console.log("newr", newr);
//sms manager
var result = new Date(sendDateTime) - new Date().getTime();
console.log(result)
document.getElementById("demo").innerHTML =
"The value of z is: " + koko + "------" + '\n'+ lolo ;
var date = moment( sendtime, "HH:mm:ss")
.add(moment().zone(), 'minutes')
.format('LTS');
var sendDateTime = moment(moment().format('YYYY-MM-DD ') + moment( sendtime, "HH:mm")
.add(moment().zone(), 'minutes')
.format('LTS'));
var result = new Date(sendDateTime) - new Date().getTime();
console.log("----")
console.log(result)
</script></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment