Skip to content

Instantly share code, notes, and snippets.

View kishore-devaraj's full-sized avatar
⚒️
Building...

Kishore Devaraj kishore-devaraj

⚒️
Building...
View GitHub Profile
@kishore-devaraj
kishore-devaraj / msconvert.js
Created March 10, 2018 20:41 — forked from remino/msconvert.js
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
function convertMS(ms) {
var d, h, m, s;
s = Math.floor(ms / 1000);
m = Math.floor(s / 60);
s = s % 60;
h = Math.floor(m / 60);
m = m % 60;
d = Math.floor(h / 24);
h = h % 24;
return { d: d, h: h, m: m, s: s };
@kishore-devaraj
kishore-devaraj / Java8DateTimeExamples.java
Created February 21, 2018 05:56 — forked from mscharhag/Java8DateTimeExamples.java
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {