What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-22 03:40:37
javascript program for analog clock
const hourHand = document.querySelector('.hand-hour'); const minuteHand = document.querySelector('.hand-minute'); const secondHand = document.querySelector('.hand-seconds'); function getTime() { const now = new Date(); cons... Add solution -
Java 2022-03-18 20:30:06
how to set username, roles, admin in jwt claims example coding in java
public String createToken(String username, List<Role> roles) { Claims claims = Jwts.claims().setSubject(username); claims.put("auth", roles.stream().map(s -> new SimpleGrantedAuthority(s.getAuthority())).filter(Objects::nonNull... Add solution -
Javascript 2022-03-18 01:35:04
javascript work out age from date of birth
function getAge(dateString) { var today = new Date(); var birthDate = new Date(dateString); var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && ... Add solution -
Java 2022-03-11 08:50:14
how to calculate 30 days from a date in java
package com.mkyong.time; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class DateExample { private static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd... Add solution -
Javascript 2022-03-08 20:25:05
Create a JavaScript Function with the name age () this function will take your date of birth as parameters and return your age in years.
// To calculate age: var year_born = prompt("Please enter your date of birth:", "Type here"); var d = new Date(); var n = d.getFullYear(); function getAge(birthYear){ var currentDate = new Date(); var currentYear = currentDate.get... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5