-
• #2
Tue 2021.04.06
'I don't normally code in java.'
To clarify:
Espruino runs a
Javascript
interpreter.Java
is a Sun Microsystems compiler language.Date:
Reference may be found at:
Example code block:
Interactive tutorial:
-
• #3
Hi! What actually happens with
Date - Date
is when you try and convertDate
into a number it gives you the milliseconds since 1970 - so you could just replace one of the dates with that.Otherwise to create a Date you can do
new Date(args)
whereargs
is either nothing (current time), one numeric argument (milliseconds since 1970), a date string (see Date.parse), or [year, month, day, hour, minute, second, millisecond].If supplying a String you can do '2011-10-20T14:48:00', '2011-10-20' or 'Mon, 25 Dec 1995 13:30:00 +0430'
Hope that's some help!
-
• #4
Thanks that is just what I needed.
So I want to find the time between two times.
The best way I have seen to do this is to just work out diff between two Date types i.e.
dif old_Date - New Date();
To do this I need to make an old_Date but I am not sure what the format really is on the bangle for date.
sorry if this is a simple question. I don't normally code in java.