Getting todays date in HISE
-
Guys, does having the number of days since 1970 fit your needs?
Do you prefer the system date? or anything?
In what format? days, hours, sec, ms, string date...
or an object with everything but I don't know if I am able to do that..
-
@ustk I think just being able to grab the current system date and time is super useful. Maybe something like
Engine.getSystemDate()
returns{ year: 2020, month: 11, day: 19, hour: 14, minute: 55, second: 32 }
But I'm sure there's a better way of returning it. This isn't my forte haha.
-
I would suggest to not go down the rabbit hole of trying to outsmart a imaginary cracker. Just make sure your plugin can‘t be copied to multiple machines by a simple user and leave the rest to companies who sell usb dongles for a living...
-
@Lunacy-Audio The juce Time class allows everything we need so it is just a matter of what we need and I'll find a way to make the API
Currently, I've made one that gives the number of days since 1970. I've just made a simple conversion since it is originally in milliseconds... -
Sounds reasonable
-
@Lunacy-Audio What sounds reasonable?
-
The number of days since 1970. Also, the addition of the function I mentioned above would be great too, but no rush.
-
@ustk The time since 1970 and also any format of system date would be great for now.
If it's too tricky to pull back an object with the attributes that @Lunacy-Audio suggested then a simple string would be useful too.Appreciate you looking into this for us
I'm sure it will come in handy for other HISE things outside of copy protection also. -
Ok guys I've added the
Engine.getSystemTime(bool includeDividerCharacters)
API from Juce
it returns a fully described string of the date and time in ISO-8601 format (using the local timezone) with or without divider characters.
It is up to you @Christoph-Hart to merge it of course, but if you find it unnecessary, the mod is easy for anyone interested...// Returns a string with separator: 2020-11-21T16:07:08.525+01:00 // Or without separator 20201121T160708.525+0100
-
@ustk Thank You!
-
@ustk Legend thanks!
-
@ustk Woo! Thanks man.
-
@Christoph-Hart is it possible to get this merged?
Cheers -
@d-healey are you still maintaining a branch that we could potentially merge this change made by @ustk to?
Desperate to make use of this 'Date Logic' but don't want to pester the man (@Christoph-Hart) anymore than we need to.Cheers
-
It‘s already merged in the main scriptnode branch.
-
Oh really?!
Legend thanks @Christoph-Hart and big thanks again to @ustk for making the change!
Downloading the latest scriptnode now... -
@LeeC look for
Engine.getSystemTime(bool includeDividerCharacters)