8 examples of 'moment utc' in JavaScript

Every line of 'moment utc' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
23function utcNowMoment() {
24 return moment.utc();
25}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

27function utcNowMoment() {
28 return exports.moment.utc();
29}
53function utc() {
54 return new Date().getTime();
55}
5export function fromUTC (utcHour) {
6 return moment.utc(utcHour, 'H').local()
7}
17function setTimeZone() {
18 const indianTimeZone = moment
19 .utc()
20 .add(5, "hours")
21 .add(30, "minutes");
22 return indianTimeZone;
23}
4function treatAsUtc(dateStr) {
5 let result = new Date(dateStr);
6 result.setMinutes(result.getMinutes() - result.getTimezoneOffset());
7 return result;
8}
5export function dateUTCToLocal( date )
6{
7 return new Date( date.getTime( ) + TimeZoneOffset );
8}
9public static get minValue(): Moment {
10 return moment.utc(Constants.UTC_MIN_VALUE);
11}

Related snippets